Thread (8 messages) flat view 8 messages, 4 authors, 2018-08-18

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

From: Duy Nguyen <hidden>
Date: 2018-08-17 15:31:46

On Fri, Aug 17, 2018 at 5:26 PM Jeff King [off-list ref] wrote:
On Fri, Aug 17, 2018 at 04:33:30PM +0200, Duy Nguyen wrote:
quoted
On Fri, Aug 17, 2018 at 8:47 AM Jonathan Nieder [off-list ref] wrote:
quoted
Nguyễn Thái Ngọc Duy wrote:
quoted
--- 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")),
[...]
quoted
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.
The alternative is -A or -M which may be easier associated with
--amend. That "--am" also would break the moment somebody adds
--amsomething.
I think "-A" has been considered as possibility for matching "commit -a"
/ "add -A" in the past, but I had trouble finding past discussion
(searching for "A" in the mailing list is not very productive). It was
mentioned in 3ba1f11426 (git-add --all: add all files, 2008-07-19), but
that was quite a while ago.

Not necessarily a blocker, but something to consider.

Like Jonathan, I do find "-j" a little non-intuitive, but I agree that
most of the intuitive ones are taken. :)
Oh well. Maybe next time we'll be more careful with adding short
options. Consider this patch dropped.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help