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

Re: [idea] File history tracking hints

From
Stefan Beller <sbeller@google.com>
Date
Oct 2, 2017, 17:41 UTC
Message-ID
<CAGZ79kbghnWmvQweup=Z79HnVQQCMM65CKgEO3oqDoRp-Bj=2Q@mail.gmail.com>
In-Reply-To
<xmqqtvzjv987.fsf@gitster.mtv.corp.google.com>
Show 5 quoted lines
>> It would be nice if every file (and tree) had a permanent GUID
>> associated with it.  Then the filename/pathname becomes a property
>> of the GUIDs.  Then you can exactly know about moves/renames with
>> minimal effort (and no guessing).
>
...
> https://public-inbox.org/git/Pine.LNX.4.58.0504150753440.7211@ppc970.osdl.org/
>
> I'd encourge people to read and re-read that message until they can
> recite it by heart.

I have rethought about the idea of GUIDs as proposed by Jeff and wanted to give a reply. After rereading this message, I think my thoughts are already included via:

  - you're doing the work at the wrong point for _another_ reason. You're
     freezing your (crappy) algorithm at tree creation time, and basically
     making it pointless to ever create something better later, because even
     if hardware and software improves, you've codified that "we have to
     have crappy information".

-- My design proposal for these "rename hints" would be a special trailer, roughly:

    Rename: LICENSE -> legal.txt
    Rename: t/* -> tests/*
or more generally:
    Rename: <pathspec> <delim> <pathspec>
This however has multiple issues due to potential
human inaccuracies:
(A) typos in the trailer key or in the pathspec
   (resulting in different error modes)
(B) partial hints (We currently have a world of
   completely missing hints, so I would not expect it to
   be worse?)
(C) wrong hints. This ought to be no problem as Git would
   take some CPU time to conclude the hint was bogus.

For (A), I would imagine we want a mechanism (e.g. notes) to "correct" the hints. This is the similar issue as a typo in a commit message, which we currently just ignore if the commit has been merged to e.g. master.

So maybe we'd just design around that, giving the option to give the correct hints via command line.

So if the commit has the typo'd hint
    Remame:  t/* -> tests/*

the human would see that (and also conclude that by the commit message), and then invoke

git log -C -C-hint="t/* -> tests/*" ...

which would have the corrected hint and hence deliver the best output.

Maybe the "-C-hint" flag is the best starting point when going in that direction?

Thanks, Stefan

Previous: Junio C HamanoNext: Jeff Hostetler
Message 13 of 18 in “[idea] File history tracking hints”
  1. Pavel KretovSep 11, 2017
  2. Stefan BellerSep 11, 2017
  3. Jacob KellerSep 11, 2017
  4. Jeff KingSep 11, 2017
  5. Igor DjordjevicSep 11, 2017
  6. Philip OakleySep 11, 2017
  7. Johannes SchindelinSep 13, 2017
  8. Philip OakleySep 14, 2017
  9. Johannes SchindelinSep 29, 2017
  10. Jeff HostetlerSep 30, 2017
  11. Johannes SchindelinSep 30, 2017
  12. Junio C HamanoOct 1, 2017
  13. Stefan BellerOct 2, 2017
  14. Jeff HostetlerOct 2, 2017
  15. Stefan BellerOct 2, 2017
  16. Jeff HostetlerOct 2, 2017
  17. Junio C HamanoOct 3, 2017
  18. Junio C HamanoOct 3, 2017

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.