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