aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/gitcli.txt
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-08-06 10:40:30 -0400
committerJunio C Hamano <gitster@pobox.com>2019-08-06 13:05:39 -0700
commit67feca3b1c45a51b204253039139b46cc07e145f (patch)
treea949c08e5694729e53013feb05a1d53d6d72044c /Documentation/gitcli.txt
parent51b4594b4024d5cb2b4ace36ff932affa31c03f4 (diff)
downloadgit-67feca3b1c45a51b204253039139b46cc07e145f.tar.gz
gitcli: document --end-of-options
Now that --end-of-options is available for any users of setup_revisions() or parse_options(), which should be effectively everywhere, we can guide people to use it for all their disambiguating needs. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/gitcli.txt')
-rw-r--r--Documentation/gitcli.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
index 1ed3ca33b7..4b32876b6e 100644
--- a/Documentation/gitcli.txt
+++ b/Documentation/gitcli.txt
@@ -37,6 +37,12 @@ arguments. Here are the rules:
file called HEAD in your work tree, `git diff HEAD` is ambiguous, and
you have to say either `git diff HEAD --` or `git diff -- HEAD` to
disambiguate.
+
+ * Because `--` disambiguates revisions and paths in some commands, it
+ cannot be used for those commands to separate options and revisions.
+ You can use `--end-of-options` for this (it also works for commands
+ that do not distinguish between revisions in paths, in which case it
+ is simply an alias for `--`).
+
When writing a script that is expected to handle random user-input, it is
a good practice to make it explicit which arguments are which by placing