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

[PATCH 0/3] I keep typing "git log --no-mailmap" X-<

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

The ultimate objective of this miniseries is to allow me to say "git log --no-mailmap" by adding an alias "--mailmap" to the existing "--use-mailmap" option.

But I had to do a little cleaning up of the OPT_ALIAS() interface, which is the topic of the first two patches. Without them, an option that is an alias to another option is shown in "git cmd -h" output like this illustration:

    $ git clone -h
    usage: git clone [<options>] [--] <repo> [<dir>]
	...
	--recursive[=<pathspec>]
			      initialize submodules in the clone
	--recurse-submodules[=<pathspec>]
			      initialize submodules in the clone
	-j, --jobs <n>        number of submodules cloned in parallel
	...

The "recursive" option is defined as an alias to "recurse-submodules", but with exactly the same short text, the user may realize that they are identical, or they may suspect they are largely similar with subtle differences that the short help text cannot adequately convey.

With the first two patches, the output becomes like this:
    $ git clone -h
    usage: git clone [<options>] [--] <repo> [<dir>]
	...
	--recurse-submodules[=<pathspec>]
			      initialize submodules in the clone
	--recursive[=<pathspec>]
			      alias of --recurse-submodules
	-j, --jobs <n>        number of submodules cloned in parallel
	...

which would make it clear that the latter is a way to spell the same thing as the other.

Junio C Hamano (3):
  parse-options: teach "git cmd -h" to show alias as alias
  clone: reorder --recursive/--recurse-submodules
  log: give --[no-]use-mailmap a more sensible synonym --[no-]mailmap
 Documentation/git-log.txt | 1 +
 builtin/clone.c           | 2 +-
 builtin/log.c             | 1 +
 parse-options.c           | 9 +++------
 t/t0040-parse-options.sh  | 2 +-
 5 files changed, 7 insertions(+), 8 deletions(-)
-- 
2.26.0-rc1-11-g30e9940356
Next: Junio C Hamano
Message 1 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.