git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-format-patch: Don't number patches when there's only one
@ 2007-10-21  8:13 Andreas Ericsson
  2007-10-22  9:44 ` Johannes Schindelin
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Ericsson @ 2007-10-21  8:13 UTC (permalink / raw)
  To: git; +Cc: spearce

[PATCH 1/1] looks a bit silly, and automagically handling
this in git-format-patch makes some scripting around it a
lot more pleasant.

Signed-off-by: Andreas Ericsson <ae@op5.se>
---
 Documentation/git-format-patch.txt |    3 ++-
 builtin-log.c                      |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index c9857a2..9f16951 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -56,7 +56,8 @@ If -o is specified, output files are created in <dir>.  Otherwise
 they are created in the current working directory.
 
 If -n is specified, instead of "[PATCH] Subject", the first line
-is formatted as "[PATCH n/m] Subject".
+is formatted as "[PATCH n/m] Subject" if the revision range to
+format contains more than one commit.
 
 If given --thread, git-format-patch will generate In-Reply-To and
 References headers to make the second and subsequent patch mails appear
diff --git a/builtin-log.c b/builtin-log.c
index e8b982d..5c48f4d 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -642,6 +642,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		list[nr - 1] = commit;
 	}
 	total = nr;
+
+	/* don't number patches when there's only one */
+	if (total == 1)
+		numbered = 0;
 	if (numbered)
 		rev.total = total + start_number - 1;
 	rev.add_signoff = add_signoff;
-- 
1.5.3.4.1273.g725c19

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

end of thread, other threads:[~2007-11-04  9:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-21  8:13 [PATCH] git-format-patch: Don't number patches when there's only one Andreas Ericsson
2007-10-22  9:44 ` Johannes Schindelin
2007-10-22 10:14   ` Andreas Ericsson
2007-10-22 10:22     ` Johannes Schindelin
2007-10-22 11:13       ` Andreas Ericsson
2007-11-03 15:44   ` [PATCH] git-format-patch: Number patches when there are more than one Mike Hommey
2007-11-03 15:59     ` Andreas Ericsson
2007-11-03 16:03       ` Mike Hommey
2007-11-03 16:32         ` Andreas Ericsson
2007-11-03 18:56           ` Samuel Tardieu
2007-11-03 16:31     ` Johannes Schindelin
2007-11-03 16:34       ` Andreas Ericsson
2007-11-04  0:25         ` Johannes Schindelin
2007-11-04  9:49           ` Andreas Ericsson

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