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

[PATCH rr/fmt-merge-msg] merge, fmt_merge_msg --log: default value is DEFAULT_MERGE_LOG_LEN

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 25, 2010, 02:44 UTC
Message-ID
<20100825024440.GD11619@burratino>
In-Reply-To
<7vzkwcvsm5.fsf@alter.siamese.dyndns.org>

Most references to the DEFAULT_MERGE_LOG_LEN were changed to use that symbolic constant, but a few uses of hardcoded "20" remain.

Cc: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Noticed this while looking over ab6beee (merge: Make '--log' an
integer option) from pu.  Maybe something like it could be squashed in
in the next round.
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 425900d..bc7c30f 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -323,10 +323,11 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
 	struct option options[] = {
 		{ OPTION_INTEGER, 0, "log", &shortlog_len, "n",
 		  "populate log with <n> entries from shortlog",
-		  PARSE_OPT_OPTARG, NULL, 20 },
+		  PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },
 		{ OPTION_INTEGER, 0, "summary", &shortlog_len, "n",
 		  "alias for --log (deprecated)",
-		  PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, NULL, 20 },
+		  PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, NULL,
+		  DEFAULT_MERGE_LOG_LEN },
 		OPT_STRING('m', "message", &message, "text",
 			"use <text> as start of message"),
 		OPT_FILENAME('F', "file", &inpath, "file to read from"),
diff --git a/builtin/merge.c b/builtin/merge.c
index bf550a6..9e4733d 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -177,7 +177,7 @@ static struct option builtin_merge_options[] = {
 	OPT_BOOLEAN(0, "summary", &show_diffstat, "(synonym to --stat)"),
 	{ OPTION_INTEGER, 0, "log", &shortlog_len, "n",
 	  "add (at most <n>) entries from shortlog to merge commit message",
-	  PARSE_OPT_OPTARG, NULL, 20 },
+	  PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },
 	OPT_BOOLEAN(0, "squash", &squash,
 		"create a single commit instead of doing a merge"),
 	OPT_BOOLEAN(0, "commit", &option_commit,
Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 5 of 13 in “merge --log configurability”
  1. 0/5 merge --log configurabilityRamkumar Ramachandra, Aug 22, 2010
  2. 1/5 fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_lenRamkumar Ramachandra, Aug 22, 2010
  3. Jonathan NiederAug 23, 2010
  4. Junio C HamanoAug 24, 2010
  5. merge, fmt_merge_msg --log: default value is DEFAULT_MERGE_LOG_LENJonathan Nieder, Aug 25, 2010
  6. 2/5 merge: Make '--log' an integer option for number of shortlog entriesRamkumar Ramachandra, Aug 22, 2010
  7. Jonathan NiederAug 23, 2010
  8. Ramkumar RamachandraAug 25, 2010
  9. 3/5 merge: Make 'merge.log' an integer or boolean optionRamkumar Ramachandra, Aug 22, 2010
  10. Junio C HamanoAug 24, 2010
  11. Ramkumar RamachandraAug 25, 2010
  12. 4/5 fmt-merge-msg: Remove deprecated '--summary' optionRamkumar Ramachandra, Aug 22, 2010
  13. 5/5 parse-options: clarify PARSE_OPT_NOARG descriptionRamkumar Ramachandra, Aug 22, 2010

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.