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

Re: Do not let lstree output recursively when a directory whose name is a prefix of the others is given in the path list.

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 9, 2010, 06:04 UTC
Message-ID
<vpqzkvr5u73.fsf@bauges.imag.fr>
In-Reply-To
<1284010826-81989-1-git-send-email-davi.reis@gmail.com>
davi.reis@gmail.com writes:
Show 9 quoted lines
> Here is how to reproduce the bug:
>
> git init
> mkdir prefix && touch prefix/a && git add prefix/a
> mkdir prefixdir && touch prefixdir/b && git add prefixdir/b
> git commit -a -m "If -r is not given, ls-tree should not show files in subdirs."
> git ls-tree --name-only HEAD prefix  # works as expected
> git ls-tree --name-only HEAD prefixdir  # works as expected
> git ls-tree --name-only HEAD prefix prefixdir  # shows file, not dir

That's so close to a real test-case... You should incorporate this in your patch (e.g. in t/t3101-ls-tree-dirname.sh), to make sure such bug never happens again.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: davi.reis@gmail.comNext: Davi Reis
Message 3 of 8 in “Do not let lstree output recursively when a directory whose name is a prefix of the others is given in the path list.”
  1. davi.reis@gmail.comSep 9, 2010
  2. Do not let lstree output recursively when a directory whose name is a prefix of the others is given in the path list.davi.reis@gmail.com, Sep 9, 2010
  3. Matthieu MoySep 9, 2010
  4. Davi ReisSep 9, 2010
  5. Matthieu MoySep 9, 2010
  6. Junio C HamanoSep 11, 2010
  7. 2/2 ls-tree $di $dir: do not mistakenly recurse into directoriesJunio C Hamano, Sep 11, 2010
  8. Matthieu MoySep 14, 2010

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.