Re: [RFC] Loosening path argument check a little bit in revision.c
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Apr 22, 2006, 16:30 UTC
- Message-ID
- <Pine.LNX.4.64.0604220921430.3701@g5.osdl.org>
- In-Reply-To
- <7vzmidkjbq.fsf@assigned-by-dhcp.cox.net>
On Sat, 22 Apr 2006, Junio C Hamano wrote:
> > This patch allows non-existing paths to be given without the > double-dash marker as long as they exist in the index, or they > are leading paths of blobs that exist in the index.
The only objection I have to this (and it's not a very strong one) is that it can cause the index to be populated for processes that really don't care.
We could work around that with a flag in "struct rev_info", so that programs that call "setup_revisions()" can specify before-hand if they are interested in the index or not.
The reason I somewhat care was that I was actually going to make the checks a bit _stronger_: I was going to say that if you have a pathspec, but don't have a "--" marker, then we'd additionally check:
- none of the arguments we parsed as revisions could be interpreted as a filename.
- none of the paths are "--"
so that there really isn't any possibility of accidental confusion in case somebody does have a revision that looks like a pathname too.
But I don't actually care _that_ deeply.
Linus