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

[PATCH 0/5] path.c: a couple of common dir/trie fixes

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Oct 21, 2019, 16:00 UTC
Message-ID
<20191021160043.701-1-szeder.dev@gmail.com>
In-Reply-To
<20191018113557.GA29845@szeder.dev>
On Fri, Oct 18, 2019 at 01:35:57PM +0200, SZEDER Gábor wrote:
> > unfortunately, see two more bugs,

And there are documentation bugs as well, both user-visible (i.e. in a man page) and in in-code comment.

Show 29 quoted lines
> > and one of them is a "proper" bug leading to bogus
> > output:
> >
> >   $ git -C WT/ rev-parse --git-path logs/refs --git-path logs/refs/
> >   /home/szeder/src/git/.git/logs/refs
> >   /home/szeder/src/git/.git/worktrees/WT/logs/refs/
> 
> This one-liner below fixes it, but I haven't yet made up my mind about
> whether this is the right fix or whether there could be any fallout
> (at least the test suite doesn't show any).
> 
>   $ ./git -C WT/ rev-parse --git-path logs/refs --git-path logs/refs/
>   /home/szeder/src/git/.git/logs/refs
>   /home/szeder/src/git/.git/logs/refs/
> 
> 
> diff --git a/path.c b/path.c
> index 04b69b9feb..9019169418 100644
> --- a/path.c
> +++ b/path.c
> @@ -335,7 +335,7 @@ static int check_common(const char *unmatched, void *value, void *baton)
>       struct common_dir *dir = value;
>  
>       if (!dir)
> -             return 0;
> +             return -1;
>  
>       if (dir->is_dir && (unmatched[0] == 0 || unmatched[0] == '/'))
>               return !dir->exclude;

Now I made up mind: this isn't the right fix :) The proper fix is in the last patch of this series.

Cc-ing David Turner, the trie's author; if I misunderstood anything, then hopefully he can spot and clarify it.

SZEDER Gábor (5):
  Documentation: mention more worktree-specific exceptions
  path.c: clarify trie_find()'s in-code comment
  path.c: mark 'logs/HEAD' in 'common_list' as file
  path.c: clarify two field names in 'struct common_dir'
  path.c: don't call the match function without value in trie_find()
 Documentation/gitrepository-layout.txt |  10 +-
 path.c                                 | 122 ++++++++++++++-----------
 t/t0060-path-utils.sh                  |   2 +
 3 files changed, 74 insertions(+), 60 deletions(-)
-- 
2.24.0.rc0.472.ga6f06c86b4
Next: SZEDER Gábor
Message 1 of 14 in “path.c: a couple of common dir/trie fixes”
  1. 0/5 path.c: a couple of common dir/trie fixesSZEDER Gábor, Oct 21, 2019
  2. 1/5 Documentation: mention more worktree-specific exceptionsSZEDER Gábor, Oct 21, 2019
  3. 3/5 path.c: mark 'logs/HEAD' in 'common_list' as fileSZEDER Gábor, Oct 21, 2019
  4. 2/5 path.c: clarify trie_find()'s in-code commentSZEDER Gábor, Oct 21, 2019
  5. 4/5 path.c: clarify two field names in 'struct common_dir'SZEDER Gábor, Oct 21, 2019
  6. 5/5 path.c: don't call the match function without value in trie_find()SZEDER Gábor, Oct 21, 2019
  7. David TurnerOct 21, 2019
  8. SZEDER GáborOct 21, 2019
  9. Junio C HamanoOct 23, 2019
  10. SZEDER GáborOct 23, 2019
  11. Junio C HamanoOct 24, 2019
  12. Johannes SchindelinOct 28, 2019
  13. SZEDER GáborOct 28, 2019
  14. Johannes SchindelinOct 28, 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.