git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] unpack-trees: do not delete i-t-a entries in worktree even when forced

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 25, 2016, 10:45 UTC
Message-ID
<CACsJy8C1fgu584Uxte+x4aHHQwishOeAzofyU7BGx0V-Pav7Kg@mail.gmail.com>
In-Reply-To
<xmqq60xdsnfr.fsf@gitster.mtv.corp.google.com>
On Thu, Feb 25, 2016 at 6:23 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Thinking about it more, I have to say that I do not agree with the
> basic premise of this patch.  I-T-A is not "may want to commit, but
> they are untracked" at all.  It is "I know I want to add, I just
> cannot yet decide the exact contents".
>
> That is why "git add -N newfile && git grep string" would find the
> string from newfile, and "git add -N newfile && git diff HEAD newfile"
> would show the addition.

We can agree to disagree. To me i-t-a is still a reminder, not a real tracked entry (with unknown content).

> Sane people would expect that "git reset --hard HEAD" would behave
> as "git diff HEAD | git apply --index -R" when your index is fully
> merged, but this change will break the expectation.

$ echo abc >abc $ git add -N abc $ git diff HEAD|LANG=C git apply --index -R error: abc: does not match index $ cat abc abc

OK this is just nit-picking. We could probably make it work, though I'm not interested in doing that.

Show 8 quoted lines
> Earlier we changed "git commit" to pretend as if an I-T-A entry does
> not exist in "git add -N newfile && git commit", but I think that
> was a mistake that was caused by the same fuzzy thinking.
>
> 3f6d56de (commit: ignore intent-to-add entries instead of refusing,
> 2012-02-07) does talk about the use of "git add -N" in conjunction
> with "git status" and "git diff", but somehow nobody realized that
> it was introducing inconsistency in the semantics.
-- 
Duy
Previous: Junio C Hamano
Message 4 of 4 in “unpack-trees: do not delete i-t-a entries in worktree even when forced”
  1. unpack-trees: do not delete i-t-a entries in worktree even when forcedNguyễn Thái Ngọc Duy, Feb 24, 2016
  2. Junio C HamanoFeb 24, 2016
  3. Junio C HamanoFeb 24, 2016
  4. Duy NguyenFeb 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.