Menu

–end-of-options
📰

–end-of-options

Hacker News·3 months ago
#N217M2XL
#nesbitt#ref#options#package#argument
Reading 0:00
15s threshold

I was reading through the fix for a package manager CVE last week and ran into a git flag I’d somehow never noticed: --end-of-options . My first reaction was that some LLM had hallucinated it, but it’s documented in gitcli(7) , it was added in git 2.24.0 in November 2019, and it exists because git had already used -- for something else.

In most Unix tools -- marks the end of option parsing, so rm -- -f removes a file called -f rather than passing the force flag. Git had repurposed -- early on to separate revisions from pathspecs, because git log foo on its own is ambiguous between a branch named foo and a file named foo and one of the two readings needed a marker: git log main -- README.md means commits on main touching that file.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.