git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] format-patch: show 0/1 and 1/1 for singleton patch with cover letter

From
Jacob Keller <jacob.e.keller@intel.com>
Date
Aug 19, 2016, 23:49 UTC
Message-ID
<20160819234959.26308-1-jacob.e.keller@intel.com>
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
Next: Junio C Hamano
Message 1 of 5 in “format-patch: show 0/1 and 1/1 for singleton patch with cover letter”
  1. format-patch: show 0/1 and 1/1 for singleton patch with cover letterJacob Keller, Aug 19, 2016
  2. Junio C HamanoAug 23, 2016
  3. Jacob KellerAug 23, 2016
  4. Junio C HamanoAug 23, 2016
  5. Jacob KellerAug 23, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.