Skip to contentSkip to conversation

git-ls-files -m lists the same file multiple times

DISCUSSION Andy Parkins 2 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I did a merge, which had conflicts, and then fixed the conflicts. To see what files I'd changed I did git-ls-files -m. This listed the same file multiple times. Some of them twice and some of them three times.

I guess that it's showing different stages; but as the list is just filename, there is no way to tell which is which and it is just confusing.

Andy

Signature · 2 lines
Dr Andy Parkins, M Eng (hons), MIET
[email protected]
#1 lore raw
Quoted 6 lines · Andy Parkins

I did a merge, which had conflicts, and then fixed the conflicts. To see what files I'd changed I did git-ls-files -m. This listed the same file multiple times. Some of them twice and some of them three times.

I guess that it's showing different stages; but as the list is just filename, there is no way to tell which is which and it is just confusing.

I did not imagine that anybody actually found 'ls-files -m' useful, either during a conflicted merge or under the normal situation. 'git diff --stat' is usually much more pleasant to see.

Use 'ls-files -u' during conflicted merge and be happy.

#2 lore raw
Quoted 6 lines · Junio C Hamano
Quoted 5 lines · Andy Parkins

I did a merge, which had conflicts, and then fixed the conflicts. To see what files I'd changed I did git-ls-files -m. This listed the same file multiple times. Some of them twice and some of them three times.

Quoted 8 lines
Quoted 3 lines

I guess that it's showing different stages; but as the list is just filename, there is no way to tell which is which and it is just confusing.

I did not imagine that anybody actually found 'ls-files -m' useful, either during a conflicted merge or under the normal situation. 'git diff --stat' is usually much more pleasant to see.

Definitely. You see I am in the strange position of being able to type faster than I can think, so typing

git-ls-files -m | xargs git add

Saves me the trouble of engaging my brain :-)

Quoted 1 line

Use 'ls-files -u' during conflicted merge and be happy.

Great stuff - that's the one I wanted; in fact git-ls-files -m did what I wanted, because it didn't matter that xargs listed the same file multiple times.

Thanks

Andy

Signature · 2 lines
Dr Andy Parkins, M Eng (hons), MIET
[email protected]
#3 lore raw
Quoted 6 lines · Andy Parkins

Definitely. You see I am in the strange position of being able to type faster than I can think, so typing

git-ls-files -m | xargs git add

Saves me the trouble of engaging my brain :-)

Well, I do not think being able to type faster is so unique. I know more than a handful people who share that ;-).

You can use "git add -u" in 1.5.2 ;-)

#4 lore raw
Quoted 2 lines · Junio C Hamano

Well, I do not think being able to type faster is so unique. I know more than a handful people who share that ;-).

:-) Absolutely - not thinking laterally enough there was I?

Quoted 1 line

You can use "git add -u" in 1.5.2 ;-)

Ahead of me again. :-) good stuff.

Andy

Signature · 2 lines
Dr Andy Parkins, M Eng (hons), MIET
[email protected]