ls-files.c: add --deduplicate option
commit93a7d9835f008488080d4f61096ee4c12ae60362
authorZheNing Hu <adlternative@gmail.com>
Sat, 23 Jan 2021 10:20:10 +0000 (23 10:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 Jan 2021 19:48:20 +0000 (23 11:48 -0800)
treeebc9337488c0bc33c4e0fdf254f2fc1da58b5dad
parented644d1666415cbed14cc6cd17a658bb56e7f28b
ls-files.c: add --deduplicate option

During a merge conflict, the name of a file may appear multiple
times in "git ls-files" output, once for each stage.  If you use
both `--delete` and `--modify` at the same time, the output may
mention a deleted file twice.

When none of the '-t', '-u', or '-s' options is in use, these
duplicate entries do not add much value to the output.

Introduce a new '--deduplicate' option to suppress them.

Signed-off-by: ZheNing Hu <adlternative@gmail.com>
[jc: extended doc and rewritten commit log]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-ls-files.txt
builtin/ls-files.c
t/t3012-ls-files-dedup.sh [new file with mode: 0755]