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

Re: [PATCH] reset cached ident date before creating objects

From
Jeff King <peff@peff.net>
Date
Aug 1, 2016, 18:00 UTC
Message-ID
<20160801180047.sgzqgh7pvp2qzwug@sigill.intra.peff.net>
In-Reply-To
<xmqqbn1cl6qv.fsf@gitster.mtv.corp.google.com>
On Mon, Aug 01, 2016 at 10:49:12AM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >> So maybe we would have to put reset_ident_date() at the end of the
> >> function instead, at least after git_committer_info() is called.
> >
> > Yes, although "reset and end" still feels a bit weird to me.
> >
> > I'd almost prefer to just have long-running programs insert resets at
> > strategic points.
> 
> Certainly "reset at the end" feels weird but it can be explained as
> "for a one-shot thing we use the first time of the default date and
> it gives a consistent timestamp; conceptually, things that make
> multiple commits are like doing that one-shot thing multiple times
> in a row."
> 
> When viewed that way, it is not _too_ bad, I would guess.

I think what bothers me is that you could use similar logic for "reset at the beginning". The problem is that we don't know when "the beginning" is. I thought it was inside commit_tree_extended(), but for some operations, it's not, as Paul showed.

So when is "the end"? Is it at the end of commit_tree_extended()? I'm not sure. Already we know it depends on whether you consider the ref update part of the same operation. Whether that matters is debatable. Are there other cases (an obvious one would be the human-readable bits printed by git-commit, but it looks like those are done beforehand)? Even if we do check every case, though, it seems like a fragile assumption to be making.

So at this point I think I'd lean towards programs which have multiple logical commit operations explicitly saying "I am starting a new operation". It may be that we end up attaching more to that in the long run than just timestamp resets, too (i.e., what other cached data might there be that used to happen in separate sub-processes?).

-Peff
Previous: Jeff KingNext: Jeff King
Message 17 of 26 in “Small trivial annoyance with the nice new builtin "git am"”
  1. Linus TorvaldsJul 28, 2016
  2. Junio C HamanoJul 28, 2016
  3. Jeff KingJul 29, 2016
  4. Linus TorvaldsJul 29, 2016
  5. Jeff KingJul 29, 2016
  6. Junio C HamanoJul 29, 2016
  7. reset cached ident date before creating objectsJeff King, Jul 29, 2016
  8. Linus TorvaldsJul 29, 2016
  9. Junio C HamanoJul 29, 2016
  10. Jeff KingJul 29, 2016
  11. Paul TanJul 30, 2016
  12. Jeff KingJul 30, 2016
  13. Junio C HamanoAug 1, 2016
  14. Junio C HamanoAug 1, 2016
  15. Jeff KingAug 1, 2016
  16. Jeff KingAug 1, 2016
  17. Jeff KingAug 1, 2016
  18. Jeff KingAug 1, 2016
  19. Junio C HamanoAug 1, 2016
  20. Jeff KingAug 1, 2016
  21. Junio C HamanoJul 29, 2016
  22. Junio C HamanoJul 29, 2016
  23. Jeff KingJul 29, 2016
  24. Linus TorvaldsJul 29, 2016
  25. Christian CouderJul 29, 2016
  26. Junio C HamanoJul 29, 2016

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.