I just realized how often I type "git ci --amend". Looking back at my
~/.bash_history (only 10k lines) this is the second most often git
command I type which may justify a short option for it (assuming that
other people use this option often too, of course).
The short option space for 'git commit' is really crowded with
acCeFhimnopqsStuvz already taken. So it could be '-M' or '-A' but I'd
prefer not to hold shift, so I chose '-j' even though it's not
strictly related to "amend" (or perhaps we can thinking of amending as
joining commits).
Thoughts?
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
builtin/commit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Jeff King <hidden> Date: 2018-08-16 18:39:06
On Thu, Aug 16, 2018 at 08:31:17PM +0200, Nguyễn Thái Ngọc Duy wrote:
I just realized how often I type "git ci --amend". Looking back at my
~/.bash_history (only 10k lines) this is the second most often git
command I type which may justify a short option for it (assuming that
other people use this option often too, of course).
The short option space for 'git commit' is really crowded with
acCeFhimnopqsStuvz already taken. So it could be '-M' or '-A' but I'd
prefer not to hold shift, so I chose '-j' even though it's not
strictly related to "amend" (or perhaps we can thinking of amending as
joining commits).
Thoughts?
I also used to type it a lot. So I did:
$ type a
a is aliased to `git commit --amend'
I don't know if that argues for or against a short option.
-Peff
On Thu, Aug 16, 2018 at 8:39 PM Jeff King [off-list ref] wrote:
On Thu, Aug 16, 2018 at 08:31:17PM +0200, Nguyễn Thái Ngọc Duy wrote:
quoted
I just realized how often I type "git ci --amend". Looking back at my
~/.bash_history (only 10k lines) this is the second most often git
command I type which may justify a short option for it (assuming that
other people use this option often too, of course).
The short option space for 'git commit' is really crowded with
acCeFhimnopqsStuvz already taken. So it could be '-M' or '-A' but I'd
prefer not to hold shift, so I chose '-j' even though it's not
strictly related to "amend" (or perhaps we can thinking of amending as
joining commits).
Thoughts?
I also used to type it a lot. So I did:
$ type a
a is aliased to `git commit --amend'
I don't know if that argues for or against a short option.
It's a "for" for me because I won't have my aliases on other people's machines.
--
Duy
From: Jonathan Nieder <hidden> Date: 2018-08-17 06:47:39
Nguyễn Thái Ngọc Duy wrote:
quoted hunk
--- 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
On Fri, Aug 17, 2018 at 8:47 AM Jonathan Nieder [off-list ref] wrote:
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'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.
I'm not opposed to a new command like this, but I don't think it
should stop us from adding short options.
--
Duy
From: Jeff King <hidden> Date: 2018-08-17 15:26:59
On Fri, Aug 17, 2018 at 04:33:30PM +0200, Duy Nguyen wrote:
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. :)
-Peff
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
From: Simon Ruderich <hidden> Date: 2018-08-18 07:27:01
On Thu, Aug 16, 2018 at 08:31:17PM +0200, Nguyễn Thái Ngọc Duy wrote:
I just realized how often I type "git ci --amend". Looking back at my
~/.bash_history (only 10k lines) this is the second most often git
command I type which may justify a short option for it (assuming that
other people use this option often too, of course).
Why not add another alias? As you're already using the ci alias,
maybe cia? Personally I have the following aliases for
committing:
c = commit --verbose
ca = commit --verbose --amend
cad = commit --verbose --amend --date=now
Besides the obvious g=git alias in the shell. I really like one
character aliases for often used commands/subcommands.
Regards
Simon
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9