[PATCH] patch-id: "diff-tree" => "commit"

Subsystems: the rest

DORMANTno replies

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] patch-id: "diff-tree" => "commit"

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:30

Some time ago we changed git-log in a massive way, and one consequence is
that the keyword changed. Adjust patch-id for that.

Signed-off-by: Johannes Schindelin <redacted>
---
 patch-id.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/patch-id.c b/patch-id.c
index edbc4aa..01845be 100644
--- a/patch-id.c
+++ b/patch-id.c
@@ -40,8 +40,8 @@ static void generate_id_list(void)
 		char *p = line;
 		int len;
 
-		if (!memcmp(line, "diff-tree ", 10))
-			p += 10;
+		if (!memcmp(line, "commit ", 7))
+			p += 7;
 
 		if (!get_sha1_hex(p, n)) {
 			flush_current_id(patchlen, sha1, &ctx);
-- 
1.4.1.rc1.g406e

Re: [PATCH] patch-id: "diff-tree" => "commit"

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:30


On Fri, 23 Jun 2006, Johannes Schindelin wrote:
Some time ago we changed git-log in a massive way, and one consequence is
that the keyword changed. Adjust patch-id for that.
Ahh. Yes. Except I think you should allow both, for historical reasons (ie 
not remove the old case).

		Linus

Re: [PATCH] patch-id: "diff-tree" => "commit"

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:30

Hi,

On Fri, 23 Jun 2006, Linus Torvalds wrote:
On Fri, 23 Jun 2006, Johannes Schindelin wrote:
quoted
Some time ago we changed git-log in a massive way, and one consequence is
that the keyword changed. Adjust patch-id for that.
Ahh. Yes. Except I think you should allow both, for historical reasons (ie 
not remove the old case).
Hmm. If you are alluding to mailboxes, where there could be mails from 
older git versions, then this might not be enough. Look at my patch, for 
example. There is no "diff-tree", and no "commit".

However, the only official user of patch-id is git-cherry (and indirectly, 
all users of git-cherry). And this user works on data which is generated 
on the fly, i.e. there will be no "diff-tree" at the beginning.

Of course, there is a Pandora's box: a line in a commit message is much 
more likely to start with "commit <sha1>" than "diff-tree <sha1>". So my 
patch probably breaks many cases.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help