git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com>
To: "Andreas Ericsson" <ae@op5.se>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
	"Wincent Colaiuta" <win@wincent.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: Question about "git commit -a"
Date: Fri, 5 Oct 2007 11:06:14 +0200	[thread overview]
Message-ID: <4d8e3fd30710050206h7a177472x7c92f91204b15aa4@mail.gmail.com> (raw)
In-Reply-To: <4705FB52.3030208@op5.se>

On 10/5/07, Andreas Ericsson <ae@op5.se> wrote:
> Paolo Ciarrocchi wrote:
> > On 10/4/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >> Hi,
> >>
> >> On Fri, 5 Oct 2007, Nguyen Thai Ngoc Duy wrote:
> >>
> >>> On 10/4/07, Wincent Colaiuta <win@wincent.com> wrote:
> >>>>> Am I wrong?
> >>>> About it being a majority, yes, I suspect so.
> >>>>
> >>> Maybe in the next survey we should include question "do you usually do
> >>> 'git commit' or 'git commit -a'" :-)
> >> Not meaning to discourage you, but it is a known fact that Linus does "git
> >> commit" without "-a" quite often.
> >>
> >> And if that were not bad enough for your plan, I myself omit "-a"
> >> regularly.  So you would get a veto from me, too.
> >
> > So you are used to do something like (please correct me if I'm wrong):
> > - modify A
> > - modify B
> > - modify C
> > - modify D
> > - modify E
> >
> > $ git A B E
>
>
> This isn't really a valid command. I'm not sure where you got it from.

Doh! Don't consider it, it's just a silly copy and paste error! It has
no meaning!

> > $ git add A B E (A, B and E are now in the staging area)
> > $ git commit -m "I just modified A,B and E"
>
> I do something like that, except that for full-file commits I'd rather
> say
>
>         git commit -s A B E
>
> I never pass -m to git commit. It's too easy to get into habit of being
> sloppy with historic documentation that way.

Right.
But in the scenario you described isn't enough to type "git commit -s".
Why did you write "git commit -s A B E".

> > $ git C D
>
> Again not a valid command, but...

See above, just a very silly copy and paste error.

> > $ git add C D (C and D are now in the staging area)
> > $ git commit -m "I just modified C and D"
> >
>
> See above :)
>
> There's also the times when I hack on some feature and find some small
> bug/easy-to-write-feature, so I make the change for that other thing,
> swap to a different branch and do 'git commit -s --interactive' to
> just break out that small fix.
>
> Or if I have to add some logic to some other function in a file I've
> modified for other purposes and want it to be two separate commits,
> I just make the change and then run 'git commit --interactive' to
> make it two separate commits.

Very interesting!

> I just don't do 'git commit -a' for the same reason I don't do
> 'git commit -m', really. It tends to be habit-forming, and bisect
> has saved my arse enough times for me to *want* my changes to be
> small and isolated. Debugging a 5-line patch is so much more pleasant
> than debugging a 30k-lines one that spans over several different files.

Yeah, I see.
Thanks for your comments Andreas, very appreciated.

Just to clarify my goal, since I had that interesting discussion with
an hg user I started looking for simple examples of the usage of the
"staging area" to be added to the introduction to git documentation.
The role of the index/staging area seems to be something complex for a
git newbie.

Regards
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
http://ubuntista.blogspot.com

  reply	other threads:[~2007-10-05  9:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04 15:38 Question about "git commit -a" Paolo Ciarrocchi
2007-10-04 15:43 ` Matthieu Moy
2007-10-04 15:48   ` Paolo Ciarrocchi
2007-10-04 15:58 ` Wincent Colaiuta
2007-10-04 20:33   ` Nguyen Thai Ngoc Duy
2007-10-04 21:10     ` Johannes Schindelin
2007-10-04 21:16       ` Nguyen Thai Ngoc Duy
2007-10-04 21:26       ` Shawn O. Pearce
2007-10-05  8:39       ` Paolo Ciarrocchi
2007-10-05  8:52         ` Andreas Ericsson
2007-10-05  9:06           ` Paolo Ciarrocchi [this message]
2007-10-05 10:02             ` Andreas Ericsson
2007-10-05 10:11               ` Matthieu Moy
2007-10-05 10:14                 ` Andreas Ericsson
2007-10-05 11:35                   ` Matthieu Moy
2007-10-05 12:17                     ` Andreas Ericsson
2007-10-05 12:19               ` Paolo Ciarrocchi
2007-10-05 12:23                 ` Andreas Ericsson
2007-10-05 12:45                   ` Matthieu Moy
2007-10-05 15:56           ` Kristian Høgsberg
2007-10-05 16:33             ` Matthieu Moy
2007-10-05 18:16             ` Marko Macek
2007-10-06  7:43               ` Andy Parkins
2007-10-06 16:13                 ` Linus Torvalds
2007-10-07 12:26               ` Wincent Colaiuta
2007-10-05 21:10             ` Dmitry Potapov
2007-10-07  6:12               ` Marko Macek
2007-10-07 14:50                 ` Dmitry Potapov
2007-10-07 16:26                 ` Johannes Schindelin
2007-10-05 10:48         ` Wincent Colaiuta
2007-10-04 21:25 ` Andy Parkins
2007-10-05  6:04   ` Miles Bader
2007-10-04 22:34 ` David Soria
2007-10-04 23:03   ` Alex Riesen
2007-10-04 23:19   ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d8e3fd30710050206h7a177472x7c92f91204b15aa4@mail.gmail.com \
    --to=paolo.ciarrocchi@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=win@wincent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).