git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: git@vger.kernel.org, Josh Triplett <josh@joshtriplett.org>,
	James Hogan <james.hogan@imgtec.com>
Cc: Jacob Keller <jacob.keller@gmail.com>
Subject: [PATCH] format-patch: show 0/1 and 1/1 for singleton patch with cover letter
Date: Fri, 19 Aug 2016 16:49:59 -0700	[thread overview]
Message-ID: <20160819234959.26308-1-jacob.e.keller@intel.com> (raw)

From: Jacob Keller <jacob.keller@gmail.com>

Change the default behavior of git-format-patch to generate numbered
sequence of 0/1 and 1/1 when generating both a cover-letter and a single
patch. This standardizes the cover letter to have 0/N which helps
distinguish the cover letter from the patch itself. Since the behavior
is easily changed via configuration as well as the use of -n and -N this
should be acceptable default behavior.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
---
 builtin/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index 92dc34dcb0cc..8e6100fb0c5b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1676,7 +1676,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		/* nothing to do */
 		return 0;
 	total = nr;
-	if (!keep_subject && auto_number && total > 1)
+	if (!keep_subject && auto_number && (total > 1 || cover_letter))
 		numbered = 1;
 	if (numbered)
 		rev.total = total + start_number - 1;
-- 
2.10.0.rc0.259.g83512d9


             reply	other threads:[~2016-08-19 23:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19 23:49 Jacob Keller [this message]
2016-08-23 16:33 ` [PATCH] format-patch: show 0/1 and 1/1 for singleton patch with cover letter Junio C Hamano
2016-08-23 21:06   ` Jacob Keller
2016-08-23 21:21   ` Junio C Hamano
2016-08-23 21:28     ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160819234959.26308-1-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=james.hogan@imgtec.com \
    --cc=josh@joshtriplett.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).