4 ms·
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 specifie
by epistasis 3mo ago
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.
- gene91 3mo agoCurrently, git log -- a -- prints all commits that affects the files whose name is a or two dashes.
- epistasis 3mo agoYes, that would change behavior slightly. To restore behavior for pathspecs including a "--" file, you would need to add an additional -- to make the revspec explicitly blank: git log -- -- a --
- gene91 3mo agoPreviously working command needs to continue behave the same way. Your original proposal was intended to provide backward compatibility (your third point in original comment), and that’s an important part of why it could work.
- peff 3mo agoIf 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".
- epistasis 3mo agoAdd in "--" a third time, and it's a file in the path spec, like it is for tools like rm.