threads / bug / 15653

[BUG] git ls-files -m --with-tree does double output

Subject: [BUG] git ls-files -m --with-tree does double output

## tl;dr

2 messages between Sep 24, 2008 and Sep 26, 2008.

replies: 1people: 2as markdown or json

Anders Melchiorsen· Sep 24, 2008, 16:19 UTC · lore

I think that this is wrong? The combination of -m and --with-tree shows duplicate entries. Git 1.6.0.2.

Cheers, Anders.

and@dylle:~$ mkdir repo ; cd repo
and@dylle:~/repo$ git init
Initialized empty Git repository in /home/and/repo/.git/
and@dylle:~/repo$ date >a ; git add a ; git commit -m'Add 1'
Created initial commit c027435: Add 1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 a
and@dylle:~/repo$ date >a
and@dylle:~/repo$ git ls-files -m --with-tree=HEAD
a
a
Jeff King· Sep 26, 2008, 22:50 UTC · re: Anders Melchiorsen · lore

Re: [BUG] git ls-files -m --with-tree does double output

On Wed, Sep 24, 2008 at 06:19:32PM +0200, Anders Melchiorsen wrote:
> I think that this is wrong? The combination of -m and --with-tree
> shows duplicate entries. Git 1.6.0.2.

I have confirmed this, and it looks like it has always been that way. It looks like overlay_tree_on_cache just does a read_tree to pull the tree into the index, and then we end up with duplicate entries.

I'm not too familiar with the read_tree code, so I am cc'ing Junio (who is out of touch for a little while) and Linus, who are much more clueful in this area.

It isn't clear to me which code is _supposed_ to be pulling out such duplicates here. That is, is read_tree broken, or is overlay_tree_on_cache just calling it wrong?

-Peff

← back to recent threads