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

[PATCH 3/3] log: give --[no-]use-mailmap a more sensible synonym --[no-]mailmap

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 16, 2020, 21:28 UTC
Message-ID
<20200316212857.259093-4-gitster@pobox.com>
In-Reply-To
<20200316212857.259093-1-gitster@pobox.com>

The option name "--use-mailmap" looks OK, but it becomes awkward when you have to negate it, i.e. "--no-use-mailmap". I, perhaps with many other users, always try "--no-mailmap" and become unhappy to see it fail.

Add an alias "--[no-]mailmap" to remedy this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-log.txt | 1 +
 builtin/log.c             | 1 +
 2 files changed, 2 insertions(+)
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index bed09bb09e..619577f23b 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -49,6 +49,7 @@ OPTIONS
 	Print out the ref name given on the command line by which each
 	commit was reached.
 
+--[no-]mailmap::
 --[no-]use-mailmap::
 	Use mailmap file to map author and committer names and email
 	addresses to canonical real names and email addresses. See
diff --git a/builtin/log.c b/builtin/log.c
index 83a4a6188e..ca1e789ba0 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -173,6 +173,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
 		OPT__QUIET(&quiet, N_("suppress diff output")),
 		OPT_BOOL(0, "source", &source, N_("show source")),
 		OPT_BOOL(0, "use-mailmap", &mailmap, N_("Use mail map file")),
+		OPT_ALIAS(0, "mailmap", "use-mailmap"),
 		OPT_STRING_LIST(0, "decorate-refs", &decorate_refs_include,
 				N_("pattern"), N_("only decorate refs that match <pattern>")),
 		OPT_STRING_LIST(0, "decorate-refs-exclude", &decorate_refs_exclude,
-- 
2.26.0-rc1-11-g30e9940356
Previous: Junio C HamanoNext: Eric Sunshine
Message 4 of 6 in “I keep typing "git log --no-mailmap" X-<”
  1. 0/3 I keep typing "git log --no-mailmap" X-<Junio C Hamano, Mar 16, 2020
  2. 2/3 clone: reorder --recursive/--recurse-submodulesJunio C Hamano, Mar 16, 2020
  3. 1/3 parse-options: teach "git cmd -h" to show alias as aliasJunio C Hamano, Mar 16, 2020
  4. 3/3 log: give --[no-]use-mailmap a more sensible synonym --[no-]mailmapJunio C Hamano, Mar 16, 2020
  5. Eric SunshineMar 16, 2020
  6. Junio C HamanoMar 16, 2020

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.