parse-options.h: add new options `--pathspec-from-file`, `--pathspec-file-nul`
commitadd97702ed7cc3aa57b15c50b72606eb2f2f8cf5
authorAlexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Wed, 6 Nov 2019 15:51:13 +0000 (6 15:51 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Nov 2019 06:11:27 +0000 (7 15:11 +0900)
treefe27af1f90f1eab3836aadc65cf14de58708e53d
parentda72936f544fec5a335e66432610e4cef4430991
parse-options.h: add new options `--pathspec-from-file`, `--pathspec-file-nul`

Support for various porcelain commands will arrive via additional
patches.

`--pathspec-from-file` solves the problem of commandline length limit
for UIs built on top of git. Plumbing commands are not always a good
fit, for two major reasons:
1) Some UIs show executed commands to user. In this case, porcelain
   commands are expected. One reason for that is letting user learn git
   commands by clicking UI buttons. The other reason is letting user
   study the history of commands in case of any unexpected results. Both
   of these will lose most of their value if UI uses combinations of
   arcane plumbing commands.
2) Some UIs have started and grown with porcelain commands. Replacing
   existing logic with plumbing commands could be cumbersome and prone
   to various new problems.

`--pathspec-from-file` will behave very close to pathspec passed in
commandline args, so that switching from one to another is simple.

`--pathspec-from-file` will read either a specified file or `stdin`
(when file is exactly "-"). Reading from file is a good way to avoid
competing for `stdin`, and also gives some extra flexibility.

`--pathspec-file-nul` switch mirrors `-z` already used in various
places. Some porcelain commands, such as `git commit`, already use
`-z`, therefore it needed a new unambiguous name.

New options do not have shorthands to avoid shorthand conflicts. It is
not expected that they will be typed in console.

Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.h