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

Re: [PATCH 0/6] "git commit --dry-run" updates

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2009, 15:57 UTC
Message-ID
<7vljlixwkz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<200908171201.43343.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 9 quoted lines
> If it's not too much work, it would be nice to somehow detect if -u
> can have any influence at all.  For example,
>
>   $ git status bar
>   # Not currently on any branch.
>   nothing to commit (use -u to show untracked files)
>
> is a bit misleading if 'bar' is tracked because adding a -u won't make
> any difference.
It is an issue shared with the original "git status".  Running
    git init
    >file
    git add file
    git commit -m initial
    git status -uno
will give the same "use -u to show" message.

The thing is, "use -u to show" is because you told git not to check if there is any untracked file. Whoever added -uno wanted not to run the recursive read_directory() to find them.

The message says "you told me not to check about untracked files, so I can not show you any, because I did not check; if you want, please use -u to tell me to check so that I can show them to you".

It is not about "we know that there are untracked files but you told me not to show it, so I am not telling". We simply do not know at the point we give that message. In other words, conditional removal of that message is fundamentally incompatible with the use of -uno.

Previous: Thomas RastNext: Thomas Rast
Message 9 of 10 in “"git commit --dry-run" updates”
  1. 0/6 "git commit --dry-run" updatesJunio C Hamano, Aug 15, 2009
  2. 1/6 Documentation/git-commit.txt: describe --dry-runJunio C Hamano, Aug 15, 2009
  3. 2/6 git commit --dry-run -v: show diff in color when askedJunio C Hamano, Aug 15, 2009
  4. 3/6 git stat: the beginningJunio C Hamano, Aug 15, 2009
  5. 4/6 git stat: pathspec limits, unlike traditional "git status"Junio C Hamano, Aug 15, 2009
  6. 5/6 git stat -s: short status outputJunio C Hamano, Aug 15, 2009
  7. 6/6 git status: not "commit --dry-run" anymoreJunio C Hamano, Aug 15, 2009
  8. Thomas RastAug 17, 2009
  9. Junio C HamanoAug 17, 2009
  10. Thomas RastAug 17, 2009

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.