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

Re: Moved files and merges

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Sep 5, 2005, 15:16 UTC
Message-ID
<431C6167.4070703@zytor.com>
In-Reply-To
<7vvf1gejjf.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 22 quoted lines
> 
>>  1
>> / \
>>0-2-3-5-7
>>   \   /
>>    4-6
>>
>>It shouldn't matter to the merge at 7 if the 2-3 reorganization was done 
>>locally, by applying a patch, or by merging.
> 
> 
> There was another problem in my message that treated #3
> specially.  I did it that way primarily because I wanted to have
> an algorithm that needs to look only limited (namely, one)
> number of commits, more than what we currently look at.  The
> problem is that the trail #0..#1..#3 (in the example in second
> message, whose rename probably happened between #0 and #1) may
> change the contents of the renamed file so drastically that diff
> between #2 and #3 may not look like rename anymore, while we
> could still detect it if we followed the whole trail and looked
> for renames between each commit on it.
> 

One question, of course, is if one should simply keep additional metadata around to handle this sort of situations. One could, for example, keep a UUID for each file, which would be carried over by the renaming commit. If one runs into a tree which doesn't have the UUIDs, they should be generated at that time (this could be a bit tricky to do without invalidating all signatures in the tree, since the obvious way -- adding it to the tree object -- would invalidate all the commit and tag objects.)

In some ways this is similar to the Unix filesystem model of separating location (pathname) from identity (device:inode).

It would also hade the somewhat interesting possibility that one could "remove and recreate" a file and have it exist as a different entity. That probably needs to be a user option.

	-hpa
Previous: Junio C HamanoNext: Linus Torvalds
Message 15 of 23 in “Moved files and merges”
  1. H. Peter AnvinSep 2, 2005
  2. Martin LanghoffSep 3, 2005
  3. H. Peter AnvinSep 4, 2005
  4. Junio C HamanoSep 3, 2005
  5. Junio C HamanoSep 3, 2005
  6. Fredrik KuivinenSep 3, 2005
  7. Junio C HamanoSep 3, 2005
  8. Junio C HamanoSep 3, 2005
  9. Sam RavnborgSep 3, 2005
  10. Junio C HamanoSep 3, 2005
  11. Sam RavnborgSep 3, 2005
  12. Junio C HamanoSep 4, 2005
  13. Daniel BarkalowSep 4, 2005
  14. Junio C HamanoSep 4, 2005
  15. H. Peter AnvinSep 5, 2005
  16. Linus TorvaldsSep 5, 2005
  17. H. Peter AnvinSep 5, 2005
  18. Junio C HamanoSep 5, 2005
  19. Junio C HamanoSep 5, 2005
  20. H. Peter AnvinSep 5, 2005
  21. Junio C HamanoSep 4, 2005
  22. Fredrik KuivinenSep 3, 2005
  23. Sam RavnborgSep 3, 2005

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.