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

Re: git status -u is mildly astonishing

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 17, 2015, 14:27 UTC
Message-ID
<vpqd1xhqfxg.fsf@anie.imag.fr>
In-Reply-To
<20150917104430.5dd73ae1@dev-05>
Alastair McGowan-Douglas <altreus@altre.us> writes:
> 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.

-u takes an optional argument. We can't consider the command-line argument following u as its argument, because that would mean

  git status -u --null
would be read as
  git status -u=--null
> The usage string implies that -- is used to disambiguate path specs
> from option arguments

Yes, but the problem here is not path specs Vs options, but anything Vs argument of the previous option.

> Therefore I would argue that -u is behaving differently from other
> arguments (especially when considered across all git subcommands)

This is because you have options with non-optional argument in mind, or options that have no short version.

If I grep the source correctly, the only options accepting a short version and an optional string argument are "{merge,am,commit,revert} -S", "grep -O" and "status -u", which behave consistantly.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Alastair McGowan-DouglasNext: Jeff King
Message 2 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.