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

git status -u is mildly astonishing

From
AMAlastair McGowan-Douglas <altreus@altre.us>
Date
Sep 17, 2015, 09:44 UTC
Message-ID
<20150917104430.5dd73ae1@dev-05>
Hi list,
Today I found what I thought was a bug in git status:
https://paste.fedoraproject.org/268333/42480833/

It seemed that the argument to -u was being ignored. It turns out that 'no' was not actually being considered an argument to -u in the first place.

The documentation supports this:
       -u[<mode>], --untracked-files[=<mode>]
           Show untracked files.

There is no space here, but it is not obvious that it is *important* that there is no space here.

The usage string implies that -- is used to disambiguate path specs from option arguments

    git status [<options>...] [--] [<pathspec>...]

Therefore I would argue that -u is behaving differently from other arguments (especially when considered across all git subcommands) by only accepting its argument when not separated by a space. This at least should be explicitly documented, but, preferably, should be consistent with other arguments and use the -- token as the separator.

-Altreus
Next: Matthieu Moy
Message 1 of 16 in “git status -u is mildly astonishing”
  1. Alastair McGowan-DouglasSep 17, 2015
  2. Matthieu MoySep 17, 2015
  3. Jeff KingSep 17, 2015
  4. Matthieu MoySep 18, 2015
  5. 0/3 Clarify the documentation of options with optional argumentsMatthieu Moy, Sep 18, 2015
  6. 1/3 Documentation: use 'keyid' consistantly, not 'key-id'Matthieu Moy, Sep 18, 2015
  7. Matthieu MoySep 18, 2015
  8. Jeff KingSep 18, 2015
  9. 2/3 Documentation/grep: fix documentation of -OMatthieu Moy, Sep 18, 2015
  10. 3/3 Documentation: make explicit that optional arguments must be stuckMatthieu Moy, Sep 18, 2015
  11. Jeff KingSep 18, 2015
  12. 0/3 Clarify the documentation of options with optional argumentsMatthieu Moy, Sep 19, 2015
  13. 1/3 Documentation: use 'keyid' consistently, not 'key-id'Matthieu Moy, Sep 19, 2015
  14. 2/3 Documentation/grep: fix documentation of -OMatthieu Moy, Sep 19, 2015
  15. 3/3 Documentation: explain optional arguments betterMatthieu Moy, Sep 19, 2015
  16. Jeff KingSep 19, 2015

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.