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

Re: RFH: unexpected reflog behavior with --since=

From
EREric Raible <raible@nextest.com>
Date
Nov 10, 2011, 07:48 UTC
Message-ID
<4EBB81EA.6060303@nextest.com>
In-Reply-To
<20111109220128.GA31535@sigill.intra.peff.net>
On 11/9/2011 2:01 PM, Jeff King wrote:
> On Tue, Nov 08, 2011 at 04:22:41PM -0800, Eric Raible wrote:
> 
> [explanation how --since is used to limits traversal omitted]
Yes, all that is as expected, and makes sense.
Show 14 quoted lines
> Now let's look at reflog walking. It's kind of bolted on to the side
> of the revision traversal machinery. We walk through the reflog
> backwards and pretend that entry N's parent is entry N-1 (you can see
> this if you do "git log -g -p", for example; you see the patch versus
> the last reflog entry, not the patch against the commit's true parent).
> 
> In the case of rewound history (like the reset you showed above), this
> means that the history graph will appear to have bad clock skew. The
> timestamp of HEAD@{0} is going to be much earlier than its pretend
> parent, HEAD@{1}. And the "--since" optimization is going to cut off
> traversal, even though there are more interesting commits to be shown.
> 
> So in that sense, I think it's a bug, and we should probably disable the
> exit-early-from-traversal optimization when we're walking reflogs.
Indeed.  Seems like a case of an optimization leading to an incorrect result.
Show 7 quoted lines
> But it may also be a misfeature, because it's not clear what you're
> actually trying to limit by. We have commit timestamps, of course, but
> when we are walking reflogs, we also have reflog timestamps. Did you
> actually want to say "show me all commits in the reflog, in reverse
> reflog order, omitting commits that happened before time t"? Or did you
> really mean "show me the reflog entries that happened before time t,
> regardless of their commit timestamp"?

I meant "show me the reflog entries that happened *since* time t, regardless of their commit timestamp.

Show 10 quoted lines
> In the latter case, we would either need a new specifier (like
> "--reflog-since"), or to rewrite the commit timestamp when we rewrite
> the parent pointers.
> 
> The latter has a certain elegance to it (we are making a pretend linear
> history graph out of the reflog, so faking the timestamps to be sensible
> and in order is a logical thing to do) but I worry about lying too much
> in the output. Something like "git log -g --format=%cd" would now have
> the fake timestamp in the output. But then, we already show the fake
> parents in the output, so I don't know that this is any worse.

Since -g is asking specifying for the reflog, and since the reflog has its own timestamps, I would expect that those timestamps be used.

Previous: Junio C HamanoNext: Jeff King
Message 12 of 13 in “RFH: unexpected reflog behavior with --since=”
  1. Eric RaibleNov 9, 2011
  2. Jeff KingNov 9, 2011
  3. Jeff KingNov 9, 2011
  4. Jeff KingNov 9, 2011
  5. Eric RaibleNov 10, 2011
  6. Jeff KingNov 10, 2011
  7. Eric RaibleNov 10, 2011
  8. Jay SoffianNov 10, 2011
  9. Miles BaderNov 10, 2011
  10. Eric RaibleNov 10, 2011
  11. Junio C HamanoNov 12, 2011
  12. Eric RaibleNov 10, 2011
  13. Jeff KingNov 10, 2011

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.