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

Re: [PATCH] tree-walk.c: fix overoptimistic inclusion in :(exclude) matching

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 4, 2018, 00:25 UTC
Message-ID
<CAPig+cS7b0nenb0+0jyXE=-bDkhapmYE8Yr6VfyAWRq3ydjPOg@mail.gmail.com>
In-Reply-To
<20181103153049.22850-1-pclouds@gmail.com>
On Sat, Nov 3, 2018 at 11:31 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 16 quoted lines
> Rules 8 and 18 are now updated to be less eager. We conclude that the
> current entry is positively matched and included. But we say nothing
> about remaining entries. tree_entry_interesting() will be called again
> for those entries where we will determine entries individually.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> diff --git a/t/t6132-pathspec-exclude.sh b/t/t6132-pathspec-exclude.sh
> @@ -194,4 +194,21 @@ test_expect_success 'multiple exclusions' '
> +test_expect_success 't_e_i() exclude case #8' '
> +       git init case8 &&
> +       (
> +               cd case8 &&
> +               echo file >file1 &&
> +               echo file >file2 &&
> +               git add . &&

Won't this loose git-add invocation end up adding all the junk files from earlier tests? One might have expected to see the more restricted invocation:

    git add file1 file2 &&

to make it easier to reason about the test and not worry about someone later inserting tests above this one which might interfere with it.

Show 9 quoted lines
> +               git commit -m twofiles &&
> +               git grep -l file HEAD :^file2 >actual &&
> +               echo HEAD:file1 >expected &&
> +               test_cmp expected actual &&
> +               git grep -l file HEAD :^file1 >actual &&
> +               echo HEAD:file2 >expected &&
> +               test_cmp expected actual
> +       )
> +'
Previous: Nguyễn Thái Ngọc DuyNext: Eric Sunshine
Message 6 of 10 in “Re: bug?: git grep HEAD with exclude in pathspec not taken into account”
  1. Christophe BliardOct 24, 2018
  2. Duy NguyenOct 24, 2018
  3. Christophe BliardOct 24, 2018
  4. Duy NguyenOct 27, 2018
  5. tree-walk.c: fix overoptimistic inclusion in :(exclude) matchingNguyễn Thái Ngọc Duy, Nov 3, 2018
  6. Eric SunshineNov 4, 2018
  7. Eric SunshineNov 4, 2018
  8. Duy NguyenNov 4, 2018
  9. tree-walk.c: fix overoptimistic inclusion in :(exclude) matchingNguyễn Thái Ngọc Duy, Nov 4, 2018
  10. Junio C HamanoNov 5, 2018

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.