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

Re: [PATCH 1/2] merge: Make '--log' an integer option for number of shortlog entries

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 31, 2010, 18:17 UTC
Message-ID
<7vzkw2abpz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100831143236.GC2315@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 11 quoted lines
> Ramkumar Ramachandra wrote:
>
>> Change the command-line '--log' option from a boolean option to an
>> integer option
>
> What does "git merge --log=-1" do?
>
> It looks like you have made "git fmt-merge-msg --log=-1" equivalent to
> --log=20, but it might be better to error out or use INT_MAX or
> something (especially because of plans to make -1 mean "infinity"
> later).

Hmm, do we plan on that? It sounds a little bit insane. Erroring it out would be Ok. How about doing this on top?

 builtin/fmt-merge-msg.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 0997c26..7c6e226 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -322,7 +322,7 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
 	const char *message = NULL;
 	struct option options[] = {
 		{ OPTION_INTEGER, 0, "log", &shortlog_len, "n",
-		  "populate log with <n> entries from shortlog",
+		  "populate log with at most <n> entries from shortlog",
 		  PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },
 		{ OPTION_INTEGER, 0, "summary", &shortlog_len, "n",
 		  "alias for --log (deprecated)",
@@ -350,7 +350,7 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
 		return 0;
 	}
 	if (shortlog_len < 0)
-		shortlog_len = DEFAULT_MERGE_LOG_LEN;
+		die("Negative --log=%d???", shortlog_len);
 
 	if (inpath && strcmp(inpath, "-")) {
 		in = fopen(inpath, "r");
Previous: Jonathan NiederNext: Jonathan Nieder
Message 7 of 12 in “rr/fmt-merge-msg replacements”
  1. 0/3 rr/fmt-merge-msg replacementsRamkumar Ramachandra, Aug 28, 2010
  2. fmt-merge-msg: Disallow '--log', 'merge.log' < 0Ramkumar Ramachandra, Aug 28, 2010
  3. 2/3 t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog lengthRamkumar Ramachandra, Aug 28, 2010
  4. 3/3 t6200-fmt-merge-msg: Exercise '--log' to configure shortlog lengthRamkumar Ramachandra, Aug 28, 2010
  5. 1/2 merge: Make '--log' an integer option for number of shortlog entriesRamkumar Ramachandra, Aug 31, 2010
  6. Jonathan NiederAug 31, 2010
  7. Junio C HamanoAug 31, 2010
  8. Jonathan NiederAug 31, 2010
  9. Ramkumar RamachandraAug 31, 2010
  10. Junio C HamanoAug 31, 2010
  11. Ramkumar RamachandraSep 1, 2010
  12. 2/2 merge: Make 'merge.log' an integer or boolean optionRamkumar Ramachandra, Aug 31, 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.