From: Junio C Hamano <gitster@pobox.com>
To: Jacob Keller <jacob.keller@gmail.com>
Cc: Jeff King <peff@peff.net>, Git mailing list <git@vger.kernel.org>
Subject: Re: tools for easily "uncommitting" parts of a patch I just commited?
Date: Thu, 20 Oct 2016 10:39:07 -0700 [thread overview]
Message-ID: <xmqqwph2hqdg.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CA+P7+xq25LcdmtzmBNChiGhGratcdp7m0EOsQuEh68=gJQ9HNQ@mail.gmail.com> (Jacob Keller's message of "Thu, 20 Oct 2016 10:27:58 -0700")
Jacob Keller <jacob.keller@gmail.com> writes:
> I still think we're misunderstanding. I want git commit to complain
> *only* under the following circumstance:
>
> I run "git add -p" and put a partial change into the index in <file>.
> There are still other parts which were not added to the index yet.
> Thus, the index version of the file and the actual file differ.
>
> Then, I (accidentally) run "git commit <file>"
I agree that this case is different.
Again, users are different, and I also often do
$ edit file; think; decide it is a good enough first cut
$ git add file
$ edit file; think; decide it is getting better
$ git add file
$ edit file; think; decide it is now perfect
$ git commit file
Because I do not think you can differentiate the above workflow from
the case where "git add -p" was used earlier, I think your updated
"git commit" needs to complain at this point.
I am not sure if that is OK. I think it is less not-OK than the use
case I mentioned in my earlier message, in that this is not a case
that "please don't do it" breaks. It however is an inconvenience
that the user has to say "git add file" before the "git commit" (or
"git commit file") to conclude the sequence.
So I dunno.
next prev parent reply other threads:[~2016-10-20 17:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 22:26 tools for easily "uncommitting" parts of a patch I just commited? Jacob Keller
2016-10-19 22:42 ` Jeff King
2016-10-19 23:36 ` Jacob Keller
2016-10-20 2:13 ` Jeff King
2016-10-20 5:53 ` Jacob Keller
2016-10-20 16:30 ` Junio C Hamano
2016-10-20 17:27 ` Jacob Keller
2016-10-20 17:39 ` Junio C Hamano [this message]
2016-10-20 18:13 ` Jacob Keller
2016-10-20 18:41 ` Junio C Hamano
2016-10-20 20:03 ` Jacob Keller
2016-10-22 9:19 ` Lukas Fleischer
2016-10-23 1:07 ` Jacob Keller
2016-10-23 1:23 ` Duy Nguyen
2016-10-23 1:38 ` Jeff King
2016-10-23 10:27 ` Duy Nguyen
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=xmqqwph2hqdg.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jacob.keller@gmail.com \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.