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

Re: Bug#757297: 'git status' output is confusing after 'git add -N'

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 7, 2014, 16:31 UTC
Message-ID
<xmqqmwbgl0r6.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8DnWZfKqwjOjjU17YtN1Zqk0vy5nyfOBLjn-RiJkKCo6Q@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 43 quoted lines
> On Thu, Aug 7, 2014 at 7:34 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Package: git
>> Version: 1:2.0.0-1
>> Tags: upstream
>>
>>   $ git init foo
>>   Initialized empty Git repository in /tmp/t/foo/.git/
>>   $ cd foo
>>   $ echo hi >README
>>   $ git add -N README
>>   $ git status
>>   On branch master
>>
>>   Initial commit
>>
>>   Changes to be committed:
>>     (use "git rm --cached <file>..." to unstage)
>>
>>           new file:   README
>>
>>   Changes not staged for commit:
>>     (use "git add <file>..." to update what will be committed)
>>     (use "git checkout -- <file>..." to discard changes in working directory)
>>
>>           modified:   README
>>
>> If I then run "git commit", it does not actually commit the addition
>> of the README file.
>
> We used to reject such a commit operation before 3f6d56d (commit:
> ignore intent-to-add entries instead of refusing - 2012-02-07) so it
> was harder to misunderstand this case.
>
>> It would be clearer to have a separate section,like so:
>>
>>   Tracked files not to be committed:
>>     (use "git rm --cached <file>..." to stop tracking)
>>
>>            new file:   README
>>
>
> Or make the "Changes not staged for commit" part say "new file:
> README" ("modified" is implied)

Yeah, after reading the justification in the quoted commit, I agree that it is status that is at fault in the above; "new file: README" is part of "Changes not staged for commit" in this case (it is told to the index, but the user never said it is "for commit" yet, which is the whole point of "-N"), so instead of adding a new section, I agree that it should be classified as "new file" not "modified" there.

Previous: Duy Nguyen
Message 2 of 2 in “Re: Bug#757297: 'git status' output is confusing after 'git add -N'”
  1. Duy NguyenAug 7, 2014
  2. Junio C HamanoAug 7, 2014

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.