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

Re: [PATCH v2] pathspec: only match across submodule boundaries when requested

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 6, 2017, 21:20 UTC
Message-ID
<alpine.DEB.2.21.1.1712062220380.98586@virtualbox>
In-Reply-To
<20171205000734.69530-1-bmwill@google.com>
Hi Brandon,
On Mon, 4 Dec 2017, Brandon Williams wrote:
Show 32 quoted lines
> Commit 74ed43711fd (grep: enable recurse-submodules to work on <tree>
> objects, 2016-12-16) taught 'tree_entry_interesting()' to be able to
> match across submodule boundaries in the presence of wildcards.  This is
> done by performing literal matching up to the first wildcard and then
> punting to the submodule itself to perform more accurate pattern
> matching.  Instead of introducing a new flag to request this behavior,
> commit 74ed43711fd overloaded the already existing 'recursive' flag in
> 'struct pathspec' to request this behavior.
> 
> This leads to a bug where whenever any other caller has the 'recursive'
> flag set as well as a pathspec with wildcards that all submodules will
> be indicated as matches.  One simple example of this is:
> 
> 	git init repo
> 	cd repo
> 
> 	git init submodule
> 	git -C submodule commit -m initial --allow-empty
> 
> 	touch "[bracket]"
> 	git add "[bracket]"
> 	git commit -m bracket
> 	git add submodule
> 	git commit -m submodule
> 
> 	git rev-list HEAD -- "[bracket]"
> 
> Fix this by introducing the new flag 'recurse_submodules' in 'struct
> pathspec' and using this flag to determine if matches should be allowed
> to cross submodule boundaries.
> 
> This fixes https://github.com/git-for-windows/git/issues/1371.

Thanks, Dscho

Previous: Junio C Hamano
Message 8 of 8 in “Bug in pathspec handling (in conjunction with submodules)”
  1. Johannes SchindelinNov 26, 2017
  2. Brandon WilliamsNov 28, 2017
  3. pathspec: only match across submodule boundaries when requestedBrandon Williams, Nov 28, 2017
  4. Johannes SchindelinNov 29, 2017
  5. Brandon WilliamsDec 5, 2017
  6. pathspec: only match across submodule boundaries when requestedBrandon Williams, Dec 5, 2017
  7. Junio C HamanoDec 5, 2017
  8. Johannes SchindelinDec 6, 2017

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.