threads / discuss / 28033

I suggest that git commit support -A option, just like hg does.thanks.

Subject: I suggest that git commit support -A option, just like hg does.thanks.

## tl;dr

7 messages between Aug 6, 2011 and Aug 8, 2011.

replies: 6people: 6as markdown or json

jelly· Aug 6, 2011, 14:32 UTC · lore
$ hg help commit
hg commit [OPTION]... [FILE]...
          -A --addremove            mark new/missing files as added/removed before committing
Magnus Bäck· Aug 6, 2011, 15:02 UTC · re: jelly · lore

Re: I suggest that git commit support -A option, just like hg does.thanks.

On Saturday, August 06, 2011 at 16:32 CEST,
     jelly <sinojelly@163.com> wrote:
> $ hg help commit
> hg commit [OPTION]... [FILE]...
>           -A --addremove            mark new/missing files as added/removed before committing
It seems like you're looking for the -A option to "git add".
-- 
Magnus Bäck                   Opinions are my own and do not necessarily
SW Configuration Manager      represent the ones of my employer, etc.
Sony Ericsson
jelly· Aug 6, 2011, 16:17 UTC · re: Magnus Bäck · lore

Re:Re: I suggest that git commit support -A option, just like hg does.thanks.

>It seems like you're looking for the -A option to "git add".

I don't want to run "git add -A" before commit,  I want to use "git commit -A -m 'msg' " instead.

Marc Weber· Aug 6, 2011, 19:35 UTC · re: jelly · lore

Re:Re: I suggest that git commit support -A option, just like hg does.thanks.

Excerpts from jelly's message of Sat Aug 06 18:17:34 +0200 2011:
> >It seems like you're looking for the -A option to "git add".
> 
> I don't want to run "git add -A" before commit, 
> I want to use "git commit -A -m 'msg' " instead.

if you need it that often add to your .bashrc: gcA(){ git add -A && git commit -m "$@"; }

which is even faster.
Marc Weber
Miles Bader· Aug 8, 2011, 04:33 UTC · re: Marc Weber · lore

Re: I suggest that git commit support -A option, just like hg does.thanks.

Marc Weber <marco-oweber@gmx.de> writes:
Show 7 quoted lines
>> I don't want to run "git add -A" before commit, 
>> I want to use "git commit -A -m 'msg' " instead.
>
> if you need it that often add to your .bashrc:
> gcA(){ git add -A && git commit -m "$@"; }
>
> which is even faster.
Remember:  "just add an alias!" is an acceptable answer only if the
desired feature is odd/unusual.  For desired features that are likely
to be generally useful, git should do the right thing, out of the box,
for everybody.

Which case this particular request falls into, is a matter of judgement, but such a feature looks "generally useful" to me.

The annoying thing, of course, is that commit and add already have inconsistent long options for this type of functionality (commit --all vs add --all). [I'd consider that a bug, regardless of whether commit gets -A type functionality, but I suppose it's too late to fix...]

-Miles
-- 
Absurdity, n. A statement or belief manifestly inconsistent with one's own
opinion.
Junio C Hamano· Aug 8, 2011, 04:56 UTC · re: Miles Bader · lore

Re: I suggest that git commit support -A option, just like hg does.thanks.

Miles Bader <miles@gnu.org> writes:
> Remember:  "just add an alias!" is an acceptable answer only if the
> desired feature is odd/unusual.  For desired features that are likely
> to be generally useful, git should do the right thing, out of the box,
> for everybody.

The reason I deliberately chose to use capital letter in "add -A" even when we do not have "add -a" was exactly so that interested parties can do "commit -A" to match it (and "commit -a" is doing the _right_ thing out of the box, and its behaviour will not change). Hopefully you can take it as a strong hint that I personally do not think "commit -A" is without merit.

So far, nobody stepped up to do it, though. I have been taking it as a sign that "commit -A" is not one of the commonly desired features but is probably closer to your "odd/unusual". It's up to the user/developer community to change that ;-)

Michael Witten· Aug 8, 2011, 14:04 UTC · re: Junio C Hamano · lore

Re: I suggest that git commit support -A option, just like hg does.thanks.

On Mon, Aug 8, 2011 at 04:56, Junio C Hamano <gitster@pobox.com> wrote:
> So far, nobody stepped up to do it, though. I have been taking it as a
> sign that "commit -A" is not one of the commonly desired features but is
> probably closer to your "odd/unusual". It's up to the user/developer
> community to change that ;-)

With regard to anything that can be changed for the better, the vast majority of people shrug their shoulders, groan, and use what's already available to them.

← back to recent threads