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

Re: [PATCH v2] config: correct '**' matching in includeIf patterns

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 25, 2019, 21:40 UTC
Message-ID
<nycvar.QRO.7.76.6.1903252233580.41@tvgsbejvaqbjf.bet>
In-Reply-To
<20190324131755.26821-1-pclouds@gmail.com>
Hi Duy,
On Sun, 24 Mar 2019, Nguyễn Thái Ngọc Duy wrote:
Show 10 quoted lines
> diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh
> index 635918505d..4d6e70c11d 100755
> --- a/t/t1305-config-include.sh
> +++ b/t/t1305-config-include.sh
> @@ -229,6 +229,19 @@ test_expect_success 'conditional include, early config reading' '
>  	)
>  '
>
> +test_expect_success 'conditional include with /**/' '
> +	mkdir foo/bar &&

This does assume that no previous test case created `bar`, but that `foo` was created (which makes it harder to use `--run=<N>` for quicker testing/debugging). It would be better to use

	mkdir -p foo/bar &&
here. Or *even* better...
> +	git init foo/bar/repo &&

... just drop the `mkdir foo/bar`, as `git init foo/bar/repo` has not the slightest problem creating the intermediate directories.

> +	(
> +		cd foo/bar/repo &&
> +		echo "[includeIf \"gitdir:**/foo/**/bar/**\"]path=bar7" >>.git/config &&

This line is longer than the 80 columns asked for in SubmittingPatches, and while you have to wrap the line anyway, why not avoid the `cd`, too?

	echo "[includeIf \"gitdir:**/foo/**/bar/**\"]path=bar7" \
		>>foo/bar/repo/.git/config &&
	echo "[test]seven=7" >foo/bar/repo/.git/bar7 &&
	echo 7 >expect &&
	git -C foo/bar/repo config test.seven >actual &&
	test_cmp expect actual

Ciao, Johannes

Show 14 quoted lines
> +		echo "[test]seven=7" >.git/bar7 &&
> +		echo 7 >expect &&
> +		git config test.seven >actual &&
> +		test_cmp expect actual
> +	)
> +'
> +
>  test_expect_success SYMLINKS 'conditional include, set up symlinked $HOME' '
>  	mkdir real-home &&
>  	ln -s real-home home &&
> --
> 2.21.0.479.g47ac719cd3
>
>
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 7 of 9 in “[BUG] Suspected with double asterisk in conditional include pattern”
  1. Jason KarnsMar 14, 2019
  2. Taylor BlauMar 22, 2019
  3. config: correct '**' matching in includeIf patternsNguyễn Thái Ngọc Duy, Mar 23, 2019
  4. Junio C HamanoMar 24, 2019
  5. config: correct '**' matching in includeIf patternsNguyễn Thái Ngọc Duy, Mar 24, 2019
  6. Junio C HamanoMar 25, 2019
  7. Johannes SchindelinMar 25, 2019
  8. config: correct '**' matching in includeIf patternsNguyễn Thái Ngọc Duy, Mar 26, 2019
  9. Jason KarnsApr 30, 2019

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.