diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-07-16 15:59:06 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-07-21 10:25:49 +0300 |
commit | 699c091b97101d08c67f84b09e0dcdee314ecfe7 (patch) | |
tree | 0d221889b03d9b9d0c6dbaa1afe65dc51b755b69 | |
parent | 8c273066c3d993bdbcd7eb2c6d6dceb1cac0f600 (diff) |
git: Adjust trivial cases of commands which support `--end-of-options`
Adjust trivial cases of commands which support `--end-of-options`
without requiring any changes in our codebase. All other commands where
we cannot enable this separator are documented, stating why we must keep
the flag.
-rw-r--r-- | internal/git/command_description.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/internal/git/command_description.go b/internal/git/command_description.go index 0876ef3e6..fa45349a9 100644 --- a/internal/git/command_description.go +++ b/internal/git/command_description.go @@ -28,9 +28,11 @@ var commandDescriptions = map[string]commandDescription{ flags: scNoRefUpdates, }, "archive": { + // git-archive(1) does not support disambiguating options from paths from revisions. flags: scNoRefUpdates | scNoEndOfOptions, }, "blame": { + // git-blame(1) does not support disambiguating options from paths from revisions. flags: scNoRefUpdates | scNoEndOfOptions, }, "bundle": { @@ -40,9 +42,13 @@ var commandDescriptions = map[string]commandDescription{ flags: scNoRefUpdates, }, "check-ref-format": { + // git-check-ref-format(1) uses a hand-rolled option parser which doesn't support + // `--end-of-options`. flags: scNoRefUpdates | scNoEndOfOptions, }, "checkout": { + // git-checkout(1) does not support disambiguating options from paths from + // revisions. flags: scNoEndOfOptions, }, "clone": { @@ -94,6 +100,8 @@ var commandDescriptions = map[string]commandDescription{ flags: scNoRefUpdates | scGeneratesPackfiles, }, "grep": { + // git-grep(1) does not support disambiguating options from paths from + // revisions. flags: scNoRefUpdates | scNoEndOfOptions, }, "hash-object": { @@ -109,13 +117,14 @@ var commandDescriptions = map[string]commandDescription{ }, }, "linguist": { + // linguist is not a native Git command, so we cannot use --end-of-options. flags: scNoEndOfOptions, }, "log": { flags: scNoRefUpdates, }, "ls-remote": { - flags: scNoRefUpdates | scNoEndOfOptions, + flags: scNoRefUpdates, }, "ls-tree": { flags: scNoRefUpdates, @@ -127,7 +136,7 @@ var commandDescriptions = map[string]commandDescription{ flags: scNoRefUpdates, }, "mktag": { - flags: scNoRefUpdates | scNoEndOfOptions, + flags: scNoRefUpdates, }, "multi-pack-index": { flags: scNoRefUpdates, @@ -139,7 +148,7 @@ var commandDescriptions = map[string]commandDescription{ flags: scNoRefUpdates | scGeneratesPackfiles, }, "push": { - flags: scNoRefUpdates | scNoEndOfOptions, + flags: scNoRefUpdates, }, "receive-pack": { flags: 0, @@ -176,6 +185,8 @@ var commandDescriptions = map[string]commandDescription{ }, hiddenReceivePackRefPrefixes()...), }, "remote": { + // While git-remote(1)'s `add` subcommand does support `--end-of-options`, + // `remove` doesn't. flags: scNoEndOfOptions, }, "repack": { @@ -210,6 +221,8 @@ var commandDescriptions = map[string]commandDescription{ }, }, "rev-parse": { + // --end-of-options is echoed by git-rev-parse(1) if used without + // `--verify`. flags: scNoRefUpdates | scNoEndOfOptions, }, "show": { @@ -228,6 +241,8 @@ var commandDescriptions = map[string]commandDescription{ flags: 0, }, "upload-archive": { + // git-upload-archive(1) has a handrolled parser which always interprets the + // first argument as directory, so we cannot use `--end-of-options`. flags: scNoRefUpdates | scNoEndOfOptions, }, "upload-pack": { @@ -240,7 +255,7 @@ var commandDescriptions = map[string]commandDescription{ }, }, "version": { - flags: scNoRefUpdates | scNoEndOfOptions, + flags: scNoRefUpdates, }, "worktree": { flags: 0, |