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

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 3 in “[RFC] Loosening path argument check a little bit in revision.c”
  1. Junio C HamanoApr 22, 2006
  2. Linus TorvaldsApr 22, 2006
  3. revision parsing: make "rev -- paths" checks stronger.Junio C Hamano, Apr 26, 2006

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.