[PATCH] git-format-patch: Number patches when there are more than one

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Cc: Andreas Ericsson <ae@...>, Johannes Schindelin <Johannes.Schindelin@...>, <spearce@...>
Date: Saturday, November 3, 2007 - 11:44 am

Automagically enable numbering if we output more than one patch.

Signed-off-by: Mike Hommey <mh@glandium.org>
---

On Mon, Oct 22, 2007 at 10:44:12AM +0100, Johannes Schindelin wrote:

How about the contrary ?


 Documentation/git-format-patch.txt |    3 ++-
 builtin-log.c                      |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index f0617ef..b77daed 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". This is the default when
+there is more than one commit to prepare patches for.
 
 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 8b2bf63..640d6e7 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -642,6 +642,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		list[nr - 1] = commit;
 	}
 	total = nr;
+	if (!keep_subject && total > 1)
+		numbered = 1;
 	if (numbered)
 		rev.total = total + start_number - 1;
 	rev.add_signoff = add_signoff;
-- 
1.5.3.5

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] git-format-patch: Don't number patches when ther..., Johannes Schindelin, (Mon Oct 22, 5:44 am)
[PATCH] git-format-patch: Number patches when there are more..., Mike Hommey, (Sat Nov 3, 11:44 am)
Re: [PATCH] git-format-patch: Number patches when there are ..., Johannes Schindelin, (Sat Nov 3, 12:31 pm)
Re: [PATCH] git-format-patch: Number patches when there are ..., Johannes Schindelin, (Sat Nov 3, 8:25 pm)
Re: [PATCH] git-format-patch: Don't number patches when ther..., Johannes Schindelin, (Mon Oct 22, 6:22 am)