git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Bug report] git log shows a wrong history
@ 2022-11-12  4:23 Adam Lee
  2022-11-12  7:13 ` SZEDER Gábor
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Lee @ 2022-11-12  4:23 UTC (permalink / raw)
  To: Git Mailing List

What did you do before the bug happened? (Steps to reproduce your issue)

```
git clone https://github.com/greenplum-db/gpdb-postgres-merge.git
git_log_reproducer

cd git_log_reproducer/

git co -b iteration_REL_12_12 origin/iteration_REL_12_12

git log
```

What did you expect to happen? (Expected behavior)

A part of the history is:
```
...
commit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f
commit fe0a9ddbdd7eee572f7321f9680280044fd5f258
...
```

What happened instead? (Actual behavior)

That part of the history is:
```
...
commit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f
commit f9c655d647427b45ae0d7bd9baf3551a013b8ea1
commit fe0a9ddbdd7eee572f7321f9680280044fd5f258
...
```

What's different between what you expected and what actually happened?

commit f9c655d647427b45ae0d7bd9baf3551a013b8ea1 is at the wrong place.

`git log --graph` is fine.

Anything else you want to add:

[System Info]
git version:
git version 2.34.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC
2022 x86_64
compiler info: gnuc: 11.2
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]

-- 
Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug report] git log shows a wrong history
  2022-11-12  4:23 [Bug report] git log shows a wrong history Adam Lee
@ 2022-11-12  7:13 ` SZEDER Gábor
  2022-11-12  8:28   ` Adam Lee
  0 siblings, 1 reply; 3+ messages in thread
From: SZEDER Gábor @ 2022-11-12  7:13 UTC (permalink / raw)
  To: Adam Lee; +Cc: Git Mailing List

On Sat, Nov 12, 2022 at 12:23:58PM +0800, Adam Lee wrote:
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> ```
> git clone https://github.com/greenplum-db/gpdb-postgres-merge.git
> git_log_reproducer
> 
> cd git_log_reproducer/
> 
> git co -b iteration_REL_12_12 origin/iteration_REL_12_12
> 
> git log
> ```
> 
> What did you expect to happen? (Expected behavior)
> 
> A part of the history is:
> ```
> ...
> commit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f
> commit fe0a9ddbdd7eee572f7321f9680280044fd5f258
> ...
> ```
> 
> What happened instead? (Actual behavior)
> 
> That part of the history is:
> ```
> ...
> commit 9ac9a7fd4138988d744e0b5767883c06c20ffa6f
> commit f9c655d647427b45ae0d7bd9baf3551a013b8ea1
> commit fe0a9ddbdd7eee572f7321f9680280044fd5f258
> ...
> ```
> 
> What's different between what you expected and what actually happened?
> 
> commit f9c655d647427b45ae0d7bd9baf3551a013b8ea1 is at the wrong place.

'git log' shows the commis in reverse chronological order by default,
which means that if development happens on multiple parallel running
branches, then commits made on different branches might be shown
intermixed.

And indeed the commit timestamp of f9c655 is between that of the other
two:

  $ git log --format='%H %ct' |grep -A2 ^9ac9a7
  9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286
  f9c655d647427b45ae0d7bd9baf3551a013b8ea1 1657195677
  fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514

(Using the seconds since epoch timestamp format here, because those
three commits were made in different time zones, making their ordering
by simply looking at them not quite that straightforward.)

Showing commits in topographical order "avoids showing commits on
multiple lines of history intermixed" (quoting the manpage), although
at the cost of slightly more processing time:

  $ git log --format='%H %ct' --topo-order |grep -A2 ^9ac9a7
  9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286
  fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514
  5a9a4091ad1a187cec9d7da0faafac15b088fe60 1657172979

> `git log --graph` is fine.

'--graph' implies '--topo-order' by default.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug report] git log shows a wrong history
  2022-11-12  7:13 ` SZEDER Gábor
@ 2022-11-12  8:28   ` Adam Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Lee @ 2022-11-12  8:28 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Git Mailing List

On Sat, Nov 12, 2022 at 3:13 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> 'git log' shows the commis in reverse chronological order by default,
> which means that if development happens on multiple parallel running
> branches, then commits made on different branches might be shown
> intermixed.
>
> And indeed the commit timestamp of f9c655 is between that of the other
> two:
>
>   $ git log --format='%H %ct' |grep -A2 ^9ac9a7
>   9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286
>   f9c655d647427b45ae0d7bd9baf3551a013b8ea1 1657195677
>   fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514
>
> (Using the seconds since epoch timestamp format here, because those
> three commits were made in different time zones, making their ordering
> by simply looking at them not quite that straightforward.)
>
> Showing commits in topographical order "avoids showing commits on
> multiple lines of history intermixed" (quoting the manpage), although
> at the cost of slightly more processing time:
>
>   $ git log --format='%H %ct' --topo-order |grep -A2 ^9ac9a7
>   9ac9a7fd4138988d744e0b5767883c06c20ffa6f 1657232286
>   fe0a9ddbdd7eee572f7321f9680280044fd5f258 1657177514
>   5a9a4091ad1a187cec9d7da0faafac15b088fe60 1657172979
>
> > `git log --graph` is fine.
>
> '--graph' implies '--topo-order' by default.
>

Ah, I see, thanks.

I didn't expect that default behavior, looks so strange to me...

-- 
Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-12  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12  4:23 [Bug report] git log shows a wrong history Adam Lee
2022-11-12  7:13 ` SZEDER Gábor
2022-11-12  8:28   ` Adam Lee

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).