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

--end-of-options inconsistently available?!

From
SSSven Strickroth <sven@cs-ware.de>
Date
Nov 27, 2023, 11:22 UTC
Message-ID
<4d944fe3-d31d-4859-8ed2-6c1da64410fe@cs-ware.de>
Hi,
gitcli(7) states:
> 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 --).
However, when I use this for certain commands it fails:

$ git reset --end-of-options HEAD -- fatal: option '--end-of-options' must come before non-option arguments

$ git rev-parse --symbolic-full-name --end-of-options master --end-of-options refs/heads/master

Here, the output also contains "--end-of-options" as if it is a reference (same for "--")

$ git checkout -f --end-of-options HEAD~1 -- afile.txt fatal: only one reference expected, 2 given.

Best,
  Sven
Next: Jeff King
Message 1 of 5 in “--end-of-options inconsistently available?!”
  1. Sven StrickrothNov 27, 2023
  2. Jeff KingNov 27, 2023
  3. Sven StrickrothNov 28, 2023
  4. Jeff KingDec 6, 2023
  5. parse-options: decouple "--end-of-options" and "--"Jeff King, Dec 6, 2023

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.