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

[PATCH 3/3] gitcli: document --end-of-options

From
Jeff King <peff@peff.net>
Date
Aug 6, 2019, 14:40 UTC
Message-ID
<20190806144030.GC2161@sigill.intra.peff.net>
In-Reply-To
<20190806143829.GA515@sigill.intra.peff.net>

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>
---
 Documentation/gitcli.txt | 6 ++++++
 1 file changed, 6 insertions(+)
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
-- 
2.23.0.rc1.436.g24d2e81391
Previous: Jeff KingNext: Junio C Hamano
Message 4 of 16 in “--end-of-options marker”
  1. 0/3 --end-of-options markerJeff King, Aug 6, 2019
  2. 1/3 revision: allow --end-of-options to end option parsingJeff King, Aug 6, 2019
  3. 2/3 parse-options: allow --end-of-options as a synonym for "--"Jeff King, Aug 6, 2019
  4. 3/3 gitcli: document --end-of-optionsJeff King, Aug 6, 2019
  5. Junio C HamanoAug 6, 2019
  6. Randall S. BeckerAug 6, 2019
  7. Jeff KingAug 6, 2019
  8. Randall S. BeckerAug 6, 2019
  9. SZEDER GáborAug 6, 2019
  10. Jeff KingAug 8, 2019
  11. Jeff KingAug 6, 2019
  12. brian m. carlsonAug 6, 2019
  13. Jeff KingAug 6, 2019
  14. brian m. carlsonAug 7, 2019
  15. Taylor BlauAug 7, 2019
  16. Jeff KingAug 8, 2019

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.