git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Get format-patch to show first commit after root commit
@ 2009-01-09 21:33 Nathan W. Panike
  2009-01-10  0:49 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Nathan W. Panike @ 2009-01-09 21:33 UTC (permalink / raw)
  To: git; +Cc: Nathan W. Panike

Rework this patch to try to handle the case where one does

git format-patch -n ...

and n is a number larger than 1.  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.

Signed-off-by: Nathan W. Panike <nathan.panike@gmail.com>
---
 builtin-log.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 4a02ee9..0eca15f 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -975,6 +975,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		nr++;
 		list = xrealloc(list, nr * sizeof(list[0]));
 		list[nr - 1] = commit;
+		if(!commit->parents){
+			rev.show_root_diff=1;
+		}
 	}
 	total = nr;
 	if (!keep_subject && auto_number && total > 1)
-- 
1.6.1.76.gc123b.dirty

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH] Get format-patch to show first commit after root commit
@ 2009-01-09 19:35 Nathan W. Panike
  2009-01-09 20:29 ` Alexander Potashev
  0 siblings, 1 reply; 15+ messages in thread
From: Nathan W. Panike @ 2009-01-09 19:35 UTC (permalink / raw)
  To: git; +Cc: Nathan W. Panike

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(-)

diff --git a/builtin-log.c b/builtin-log.c
index 4a02ee9..5e7b61f 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -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)
-- 
1.6.1.76.gc123b.dirty

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* (unknown)
@ 2009-01-09 19:02 nathan.panike
  2009-01-10 10:27 ` [PATCH] Get format-patch to show first commit after root commit Johannes Schindelin
  0 siblings, 1 reply; 15+ messages in thread
From: nathan.panike @ 2009-01-09 19:02 UTC (permalink / raw)


>From 65c4fed27fe9752ffd0e3b7cb6807561a4dd4601 Mon Sep 17 00: 00:00 2001
From: Nathan W. Panike <nathan.panike@gmail.com>
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(-)

diff --git a/builtin-log.c b/builtin-log.c
index 4a02ee9..5e7b61f 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -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)
-- 
1.6.1.76.gc123b.dirty

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-01-10 20:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09 21:33 [PATCH] Get format-patch to show first commit after root commit Nathan W. Panike
2009-01-10  0:49 ` Junio C Hamano
2009-01-10  1:37   ` Nathan W. Panike
2009-01-10 11:36   ` Alexander Potashev
2009-01-10 11:39     ` [PATCH] format-patch: avoid generation of empty patches Alexander Potashev
2009-01-10 16:01       ` Nathan W. Panike
2009-01-10 16:17         ` Alexander Potashev
2009-01-10 18:07           ` Nathan W. Panike
2009-01-10 20:41         ` Junio C Hamano
2009-01-10 16:39       ` [PATCH] Add new testcases for format-patch root commits Alexander Potashev
2009-01-10 18:33         ` Alexander Potashev
  -- strict thread matches above, loose matches on Subject: below --
2009-01-09 19:35 [PATCH] Get format-patch to show first commit after root commit Nathan W. Panike
2009-01-09 20:29 ` Alexander Potashev
2009-01-09 19:02 (unknown) nathan.panike
2009-01-10 10:27 ` [PATCH] Get format-patch to show first commit after root commit Johannes Schindelin
2009-01-10 10:35   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).