Web lists-archives.com

Re: [PATCH/RFC] Makefile: dedup list of files obtained from ls-files




On Wed, Apr 24, 2019 at 7:26 AM SZEDER Gábor <szeder.dev@xxxxxxxxx> wrote:
> On second thought, however, I'm not sure that such a '--dedup' option
> would be all that useful in the above cases.  If the users have to
> adjust their 'git ls-files' invocation by specifying '--dedup' to
> avoid the same paths listed multiple times, then they might just as
> well remove the redundant options.  After all, a deleted file is
> inherently modified, and a modified file is inherently cached...

As a person who rarely, if ever, uses git-ls-files, I'm having trouble
understanding why de-duping isn't the default behavior when the
listing is otherwise not annotated (that is, when -t/-v/-f/--debug are
not used). Are consumers of an unannotated list able to derive any
additional useful information from the duplicate entries? If consumers
can't derive anything useful, then the duplication seems more an
accident of implementation (for the unannotated case) than a planned
feature, thus could be considered a bug worth fixing. And, the fix
would be to de-dup by default when unannotated, thus no need for a
--dedup option. (As for backward-compatibility concerns, I imagine
that existing consumers either don't care about the duplication or
already manually de-dup, but perhaps I'm not seeing the larger
picture.)