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

Re: [PATCH/RFC] commit: add short option for --amend

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 17, 2018, 06:47 UTC
Message-ID
<20180817064734.GB131749@aiede.svl.corp.google.com>
In-Reply-To
<20180816183117.13716-1-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
Show 8 quoted lines
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -1489,7 +1489,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>  			    STATUS_FORMAT_LONG),
>  		OPT_BOOL('z', "null", &s.null_termination,
>  			 N_("terminate entries with NUL")),
> -		OPT_BOOL(0, "amend", &amend, N_("amend previous commit")),
> +		OPT_BOOL('j', "amend", &amend, N_("amend previous commit")),
[...]
> Thoughts?

I'm not a fan. I would have trouble remembering what the short option name means, and it matches the common --jobs option for parallelism that many commands use. "git commit --am" works today already and doesn't run into those problems.

I'm sympathetic to the goal of saving typing, but I'm more sympathetic to the goal of making user support easier, which is what makes me end up there.

That said, I've been looking recently at Mercurial's "hg evolve" extension[1] and I wouldn't be against a well thought out new command (e.g. "git amend") that does the equivalent of "git commit --amend" with some related features. So I think there are some paths forward that involve abbreviating.

Thanks, Jonathan

[1] https://www.mercurial-scm.org/wiki/EvolveExtension
Previous: Duy NguyenNext: Duy Nguyen
Message 4 of 9 in “commit: add short option for --amend”
  1. commit: add short option for --amendNguyễn Thái Ngọc Duy, Aug 16, 2018
  2. Jeff KingAug 16, 2018
  3. Duy NguyenAug 16, 2018
  4. Jonathan NiederAug 17, 2018
  5. Duy NguyenAug 17, 2018
  6. Jeff KingAug 17, 2018
  7. Duy NguyenAug 17, 2018
  8. Junio C HamanoAug 17, 2018
  9. Simon RuderichAug 18, 2018

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.