From: Johannes Sixt <j.sixt@viscovery.net>
To: Nathan Yergler <nathan@creativecommons.org>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
Asheesh Laroia <asheesh@asheesh.org>,
git@vger.kernel.org
Subject: Re: Short "git commit $file" syntax fails in the face of a resolved conflict
Date: Thu, 22 Jan 2009 08:28:44 +0100 [thread overview]
Message-ID: <4978202C.3090703@viscovery.net> (raw)
In-Reply-To: <c1a864630901211346j4b702fb3tcc5a098ed7e1541d@mail.gmail.com>
Please don't top-post.
Nathan Yergler schrieb:
> Can you elaborate on why doing -i automatically is a bad idea in this
> case? [It may really be, I don't pretend to have enough knowledge
> about git's internals to make a reasoned argument.] This was
> unexpected behavior for me as I'd always experienced "git add path &&
> git commit" and "git commit path" as being equivalent and so I assumed
> they would work equivalently in this situation.
They are not equivalent. 'git add path && git commit' commits changes to
path *in addition* to what is already staged before you run this command
sequence. But 'git commit path' commits *only* changes to path, leaving
other changes that might be staged uncommitted.
It may become obvious why the latter behavior is unwanted if a merge is in
progress: The merge left changes (and conflicts) in the index; but with
'git commit path' you say that you are not interested in what the index has.
-- Hannes
next prev parent reply other threads:[~2009-01-22 7:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 21:00 Short "git commit $file" syntax fails in the face of a resolved conflict Asheesh Laroia
2009-01-21 21:35 ` Michael J Gruber
2009-01-21 21:46 ` Nathan Yergler
2009-01-22 7:28 ` Johannes Sixt [this message]
2009-01-22 9:17 ` Michael J Gruber
2009-01-23 0:45 ` Nanako Shiraishi
2009-01-23 2:55 ` Asheesh Laroia
2009-01-23 6:15 ` Junio C Hamano
2009-01-23 6:17 ` [PATCH 1/3] Add "partial commit" tests during a conflicted merge Junio C Hamano
2009-01-23 7:09 ` Johannes Sixt
2009-01-23 7:16 ` Junio C Hamano
2009-01-23 7:32 ` Johannes Sixt
2009-01-23 7:39 ` Junio C Hamano
2009-01-23 6:19 ` [PATCH 2/3] builtin-commit: shorten eye-sore overlong lines Junio C Hamano
2009-01-23 6:21 ` [PATCH 3/3] git commit: pathspec without -i/-o implies -i semantics during a merge Junio C Hamano
2009-01-23 9:51 ` Pieter de Bie
2009-01-23 17:01 ` Junio C Hamano
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=4978202C.3090703@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=asheesh@asheesh.org \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=nathan@creativecommons.org \
/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).