logoalt Hacker News

epistasistoday at 4:53 AM2 repliesview on HN

Perhaps I'm missing something (it's been a long day), but couldn't "--" be used for both?

    git cmd --options -- rev -- pathspec
would be the fully specified revspec and pathspec

    git cmd --option -- rev --
would be just the revspec, excluding accidental options, without a pathspec

    git cmd --option revspec -- pathspec
and the single "--" would work as it currently does.

Replies

pefftoday at 11:12 AM

If it's used for both, then you couldn't have "--" itself as a pathspec. In your first example, the current meaning is: a pathspec containing "rev", "--", and "pathspec".

gene91today at 5:26 AM

Currently, git log -- a -- prints all commits that affects the files whose name is a or two dashes.