git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	git@vger.kernel.org, "Jeff King" <peff@peff.net>,
	"Will Palmer" <wmpalmer@gmail.com>
Subject: Re: [PATCH RFC] commit: allow to commit even if there are intent-to-add entries
Date: Wed, 11 Jan 2012 13:08:52 -0800	[thread overview]
Message-ID: <7vr4z654m3.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120111110222.GA32173@burratino> (Jonathan Nieder's message of "Wed, 11 Jan 2012 05:02:22 -0600")

Jonathan Nieder <jrnieder@gmail.com> writes:

>> When running "commit" and "status" with files marked with "intent to add",
>> I think there are three possible interpretations of what the user
>> wants to do.
> [ (1) thanks for stopping me, I had forgotten about that file;
>   (2) I changed my mind, please leave that file out; or (3) please
>   dwim and add the file ]
>
> I think (3) was a trick --- no one that does not use the "-a" option
> would want that. :)

I really wish it were the case, but I doubt it.

People from other VCS background seem to still think that "commit" without
paths should commit everything; after getting told that "what you add to
the index is what you will commit", I can easily see this commint: but but
but I told Git that I _want_ to add with -N! Why aren't you committing it?

> At the time, I did not understand what (2) meant.  Now I see why ---
> in interpretation (2), the user did not change her mind at all.

You are correct. "I still cannot make up my mind" is what is happening in
that situation.

The user explicitly said "I cannot decide about this path right now" when
she said "add -N". And we haven't heard from the user what should happen
to the path. Now we have to make a commit so somebody needs to decide.

> She
> said "I will be adding this file at some point, so please keep track
> of it along with the others for the sake of commands like 'git diff'
> and 'git add -u', but that does not mean "I will be adding this file
> at some point _before the next commit_".

Correct. She only said "I cannot decide right now" when she said "add -N"
and hasn't gave us any more hint as to what should happen now we have to
make a commit.

It is _wrong_ for us to unilaterally decide for the user that she does not
want the path in the commit. The last we heard from her was that she does
not know what should happen to the path.

> (2) makes intent-to-add entries just like any other tracked index
> entry with some un-added content.

You are comparing files edited in the working tree without the user
telling anything about them to Git (both tracked and untracked) and files
the user explicitly told Git that the user hasn't made up her mind
about. Why is it a good thing to make the latter behave "just like any
other"?

  reply	other threads:[~2012-01-11 21:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11  6:01 [PATCH RFC] commit: allow to commit even if there are intent-to-add entries Nguyễn Thái Ngọc Duy
2012-01-11  8:08 ` Junio C Hamano
2012-01-11 11:02   ` Jonathan Nieder
2012-01-11 21:08     ` Junio C Hamano [this message]
2012-01-12  2:53       ` Nguyen Thai Ngoc Duy
2012-01-12  3:05         ` Junio C Hamano
2012-01-11  9:59 ` Nguyễn Thái Ngọc Duy
2012-01-11  9:59 ` [PATCH 1/2] cache-tree: update API to take abitrary flags Nguyễn Thái Ngọc Duy
2012-01-11 23:48   ` Junio C Hamano
2012-01-12  1:20     ` Nguyen Thai Ngoc Duy
2012-01-11  9:59 ` [PATCH 2/2] commit: add --skip-intent-to-add to allow commit with i-t-a entries in index Nguyễn Thái Ngọc Duy
2012-01-11 23:55   ` 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=7vr4z654m3.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=wmpalmer@gmail.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).