Skip to contentSkip to conversation

(unknown)

PATCH [email protected] 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

From 65c4fed27fe9752ffd0e3b7cb6807561a4dd4601 Mon Sep 17 00: 00:00 2001

From: Nathan W. Panike <[email protected]>
Date: Fri, 9 Jan 2009 11:53:43 -0600
Subject: [PATCH] Get format-patch to show first commit after root commit

Currently, the command

git format-patch -1 e83c5163316f89bfbde

in the git repository creates an empty file. Instead, one is forced to do

git format-patch -1 --root e83c5163316f89bfbde

This seems arbitrary. This patch fixes this case, so that

git format-patch -1 e83c5163316f89bfbde

will produce an actual patch.

---
 builtin-log.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
builtin-log.c +2 -0
index 4a02ee9..5e7b61f 100644
@@ -977,6 +977,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		list[nr - 1] = commit;
 	}
 	total = nr;
+	if (total == 1 && !list[0]->parents)
+		rev.show_root_diff=1;
 	if (!keep_subject && auto_number && total > 1)
 		numbered = 1;
 	if (numbered)
Signature · 1 line
1.6.1.76.gc123b.dirty
#1 lore raw

Re: [PATCH] Get format-patch to show first commit after root commit

Hi,

your mailing process has a problem; neither the recipients nor the subject made it into the mail header.

Quoted 8 lines · On Fri, 9 Jan 2009, [email protected] wrote:
Quoted 1 line

From 65c4fed27fe9752ffd0e3b7cb6807561a4dd4601 Mon Sep 17 00: 00:00 2001

From: Nathan W. Panike <[email protected]>
Date: Fri, 9 Jan 2009 11:53:43 -0600
Subject: [PATCH] Get format-patch to show first commit after root commit

Currently, the command

git format-patch -1 e83c5163316f89bfbde

You do not need -1, and using 19 digits seems a bit arbitrary; the convention seems to be 7 digits (that is what --abbrev-commit does).

Quoted 11 lines

in the git repository creates an empty file. Instead, one is forced to do

git format-patch -1 --root e83c5163316f89bfbde

This seems arbitrary. This patch fixes this case, so that

git format-patch -1 e83c5163316f89bfbde

will produce an actual patch.

IMHO mentioning --root is misleading, as the real bug is the empty diff.

Apart from that, I like the patch, though.

Thanks,
Dscho

#2 lore raw

Re: [PATCH] Get format-patch to show first commit after root commit

Hi,

Quoted 7 lines · Johannes Schindelin
Quoted 5 lines · On Fri, 9 Jan 2009, [email protected] wrote:
Quoted 1 line

From 65c4fed27fe9752ffd0e3b7cb6807561a4dd4601 Mon Sep 17 00: 00:00 2001

From: Nathan W. Panike <[email protected]>
Date: Fri, 9 Jan 2009 11:53:43 -0600
Subject: [PATCH] Get format-patch to show first commit after root commit

Quoted 6 lines
Quoted 3 lines

Currently, the command

git format-patch -1 e83c5163316f89bfbde

You do not need -1, and using 19 digits seems a bit arbitrary; the convention seems to be 7 digits (that is what --abbrev-commit does).

Sorry, the -1 is needed.

Ciao,
Dscho