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

impure renames / history tracking

From
PJPaul Jakma <paul@clubi.ie>
Date
Mar 1, 2006, 14:01 UTC
Message-ID
<Pine.LNX.4.64.0603011343170.13612@sheen.jakma.org>
Hi,

I'm trying to understand git better (so I can explain it better to others, with an eye to them considering switching to git), one question I have is about renames.

- git obviously detects pure renames perfectly well
- git doesn't however record renames, so 'impure' renames may not be
   detected
My question is:
- why not record rename information explicitely in the commit object?

I.e. so as to be able to follow history information through 'impure' renames without having to resort to heuristics.

E.g. imagine a project where development typically occurs through:

o: commit m: merge

    o---o-m--o-o-o--o----m <- project
   /     /              /
o-o-o-o-o--o-o-o--o-o-o <- main branch

The project merge back to main in one 'big' combined merge (collapsing all of the commits on 'project' into one commit). This leads to 'impure renames' being not uncommon. The desired end-result of merging back to 'main' being to rebase 'project' as one commit against 'main', and merge that single commit back, a la:

    o---o-m--o-o-o--o----m <- project
   /     /              /
o-o-o-o-o--o-o-o--o-o-o---m <- main branch
                        \ /
                         o <- project_collapsed
So that 'm' on 'main' is that one commit[1].

The merits or demerits of such merging practice aside, what reason would there be /against/ recording explicit rename information in the commit object, so as to help browsers follow history (particularly impure renames) better in a commit?

I.e. would there be resistance to adding meta-info rename headers commit objects, and having diffcore and other tools to use those headers to /augment/ their existing heuristics in detecting renames?

Thanks!
1. Git currently doesn't have 'porcelain' to do this, presumably 
there'd be no objection to one?
regards,
-- 
Paul Jakma	paul@clubi.ie	paul@jakma.org	Key ID: 64A2FF6A
Fortune:
It is the quality rather than the quantity that matters.
- Lucius Annaeus Seneca (4 B.C. - A.D. 65)
Next: Andreas Ericsson
Message 1 of 15 in “impure renames / history tracking”
  1. Paul JakmaMar 1, 2006
  2. Andreas EricssonMar 1, 2006
  3. Paul JakmaMar 1, 2006
  4. Linus TorvaldsMar 1, 2006
  5. Paul JakmaMar 1, 2006
  6. Andreas EricssonMar 1, 2006
  7. Paul JakmaMar 2, 2006
  8. Andreas EricssonMar 2, 2006
  9. Martin LanghoffMar 1, 2006
  10. Paul JakmaMar 1, 2006
  11. Junio C HamanoMar 1, 2006
  12. Paul JakmaMar 1, 2006
  13. Andreas EricssonMar 1, 2006
  14. Paul JakmaMar 1, 2006
  15. Junio C HamanoMar 1, 2006

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.