git status -u is mildly astonishing
- From
- Alastair 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