From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format.
Date: Mon, 23 May 2005 11:43:01 -0700 [thread overview]
Message-ID: <7vwtpp3hsa.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0505230736180.2307@ppc970.osdl.org> (Linus Torvalds's message of "Mon, 23 May 2005 07:49:01 -0700 (PDT)")
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> Btw, I still disagree with this notion that the order of the
LT> use of the names makes a difference.
Having slept over it, I think I tend to agree. I do not mind
annotating diff-raw output with "is this copy or is this rename"
bit anymore. While we are at it, I would also want to either
(1) add similarity index field to diff-raw output, or (2) drop
similarity index output from the built-in patch output. I am
inclined to vote for the former right now (if only it is more
fun to watch), but I can easily be dissuaded.
The proposed diff-raw format, in its fully expended form, is this:
in-place edit :100644 100644 bcd1234... 0123456... file0 file0 . 0
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 file4 . 0
delete :100644 000000 1234567... 0000000... file5 file5 . 0
unmerged :000000 000000 0000000... 0000000... file6 file6 . 0
The two columns added are rename/copy bit and similarity index.
When one->path and two->path are the same, they do not mean
anything but for parser simplicity's sake I'd like to have 0 in
the similarity index field and a dot in copy/rename bit field.
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
This has a nice property that diff-helper, aside from its
diff-raw parsing part, can become quite simplified. It should
lose rename/copy related flags (-M, -C) because they are already
detected by the tool in the upstream of the pipe; and because
rename-copy is an asymmetric operation, it should also lose the
-R flag. I think it already does a wrong thing when you use
diff-tree brothers with -M or -C and feed diff-helper -R with
the output that contains already matched rename/copy.
The only thing diff-helper _will_ continue to do is to take a
diff-raw output prepared by diff-tree brothers, and generate
what the upstream tool would have generated if it were given
'-p' (and that should have been the case from the beginning).
Although I think diffcore transformers other than rename/copy
may still be useful (like pickaxe) in diff-helper, that also can
be handled upstream.
next prev parent reply other threads:[~2005-05-23 18:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-23 7:26 [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format Junio C Hamano
2005-05-23 14:49 ` Linus Torvalds
2005-05-23 18:43 ` Junio C Hamano [this message]
2005-05-23 19:03 ` Linus Torvalds
2005-05-23 19:16 ` Linus Torvalds
2005-05-23 21:55 ` [PATCH] diff-raw format update take #2 Junio C Hamano
2005-05-23 22:08 ` Junio C Hamano
2005-05-24 0:12 ` Chris Wedgwood
2005-05-24 0:25 ` Junio C Hamano
2005-05-24 0:31 ` Chris Wedgwood
2005-05-24 0:45 ` Junio C Hamano
2005-05-24 1:03 ` Linus Torvalds
2005-05-24 1:05 ` Chris Wedgwood
2005-05-24 1:29 ` David Lang
2005-05-24 1:33 ` Chris Wedgwood
2005-05-24 1:39 ` Thomas Glanzmann
[not found] ` <20050524013947.ADFEE528F53@taniwha.stupidest.org>
2005-05-24 1:44 ` Thomas Glanzmann
2005-05-24 1:50 ` Linus Torvalds
2005-05-24 0:51 ` Linus Torvalds
2005-05-26 0:55 ` [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vwtpp3hsa.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.