Skip to content

pr-832/adlternative/ls-files-dedup-v6

I am reading the source code of git ls-files and learned that git ls-files
may have duplicate files name when there are unmerged path in a branch merge
or when different options are used at the same time. Users may fell confuse
when they see these duplicate file names.

As Junio C Hamano said ,it have odd behaviour.

Therefore, we can provide an additional option to git ls-files to delete
those repeated information.

This fixes https://github.com/gitgitgadget/git/issues/198

Thanks!

ZheNing Hu (3):
  ls_files.c: bugfix for --deleted and --modified
  ls_files.c: consolidate two for loops into one
  ls-files.c: add --deduplicate option

 Documentation/git-ls-files.txt |  5 ++
 builtin/ls-files.c             | 85 ++++++++++++++++++++--------------
 t/t3012-ls-files-dedup.sh      | 66 ++++++++++++++++++++++++++
 3 files changed, 121 insertions(+), 35 deletions(-)
 create mode 100755 t/t3012-ls-files-dedup.sh

base-commit: 6d3ef5b467eccd2769f1aa1c555d317d3c8dc707

Submitted-As: https://lore.kernel.org/git/pull.832.v6.git.1611397210.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.832.git.1609923182451.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.832.v2.git.1610116600.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.832.v3.git.1610626942677.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.832.v4.git.1610856136.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.832.v5.git.1611037846.gitgitgadget@gmail.com
Assets 2