git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Bug report] git log shows a wrong history

From
ALAdam Lee <adam8157@gmail.com>
Date
Nov 12, 2022, 08:28 UTC
Message-ID
<CABAGCCpdKesUaNiJmH4w8OqTWbXiPNJ2tRM-XwPs6ndUpzEXbg@mail.gmail.com>
In-Reply-To
<20221112071313.GE1159673@szeder.dev>
On Sat, Nov 12, 2022 at 3:13 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 30 quoted lines
> '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
Previous: SZEDER Gábor
Message 3 of 3 in “[Bug report] git log shows a wrong history”
  1. Adam LeeNov 12, 2022
  2. SZEDER GáborNov 12, 2022
  3. Adam LeeNov 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.