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

Re: [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format.

From
Linus Torvalds <torvalds@osdl.org>
Date
May 23, 2005, 19:03 UTC
Message-ID
<Pine.LNX.4.58.0505231156210.2307@ppc970.osdl.org>
In-Reply-To
<7vwtpp3hsa.fsf@assigned-by-dhcp.cox.net>
On Mon, 23 May 2005, Junio C Hamano wrote:
Show 10 quoted lines
> 
> Human readable form should omit two->path and later fields
> altogether if one->path == two->path, so the above becomes:
> 
> in-place edit  :100644 100644 bcd1234... 0123456... file0
> copy-edit      :100644 100644 abcd123... 1234567... file1 file2 C 68
> rename-edit    :100644 100644 abcd123... 1234567... file1 file3 R 86
> create         :000000 100644 0000000... 1234567... file4
> delete         :100644 000000 1234567... 0000000... file5
> unmerged       :000000 000000 0000000... 0000000... file6

I'm ok with that format, although I'd actually prefer the "what happened" thing to come before the pathnames in the "fixed size" section, something like

in-place edit :100644 100644 bcd1234... 0123456... M file0 copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 create :000000 100644 0000000... 1234567... N file4 delete :100644 000000 1234567... 0000000... D file5 unmerged :000000 000000 0000000... 0000000... U file6

because having it there makes it just easier to parse, and means that we can add "reasons" later without having to worry about ambiguities with filenames. It means, for example, that the chacter that describes what that line does _always_ comes at the same byte offset in the line. That's just very convenient for everybody.

(In the above, I left the "similarity index" thing in, but it's not important for the algorithm, and you could leave it out. It's nice for debugging, and the major reason to not have it is the fact that it makes for non-constant format offsets for the first filename).

			Linus
Previous: Junio C HamanoNext: Linus Torvalds
Message 4 of 20 in “Make sure diff-helper can tell rename/copy in the new diff-raw format.”
  1. Make sure diff-helper can tell rename/copy in the new diff-raw format.Junio C Hamano, May 23, 2005
  2. Linus TorvaldsMay 23, 2005
  3. Junio C HamanoMay 23, 2005
  4. Linus TorvaldsMay 23, 2005
  5. Linus TorvaldsMay 23, 2005
  6. diff-raw format update take #2.Junio C Hamano, May 23, 2005
  7. diff-raw format update take #2.Junio C Hamano, May 23, 2005
  8. Chris WedgwoodMay 24, 2005
  9. Junio C HamanoMay 24, 2005
  10. Chris WedgwoodMay 24, 2005
  11. Junio C HamanoMay 24, 2005
  12. Linus TorvaldsMay 24, 2005
  13. Chris WedgwoodMay 24, 2005
  14. David LangMay 24, 2005
  15. Chris WedgwoodMay 24, 2005
  16. Thomas GlanzmannMay 24, 2005
  17. Linus TorvaldsMay 24, 2005
  18. Linus TorvaldsMay 24, 2005
  19. Junio C HamanoMay 26, 2005
  20. Thomas GlanzmannMay 24, 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.