From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH/RFC] Makefile: dedup list of files obtained from ls-files
Date: Wed, 24 Apr 2019 13:25:50 +0200 [thread overview]
Message-ID: <20190424112550.GC8695@szeder.dev> (raw)
In-Reply-To: <xmqqlg0043km.fsf@gitster-ct.c.googlers.com>
On Wed, Apr 24, 2019 at 10:03:37AM +0900, Junio C Hamano wrote:
> SZEDER Gábor <szeder.dev@gmail.com> writes:
>
> > I remember being rather puzzled by 'git ls-files' listing the same
> > file more than once depending on its --options when I was working on
> > the git-aware path completion parts of our completion script.
>
> Yup, I recall a thread we recently had where we wondered why we see
> two entries reported when we ask for 'modified' and 'deleted' at the
> same time.
>
> Perhaps not-so-low-hanging fruit miniproject would be to teach
> "ls-files" a new "--dedup" option that does two things:
>
> * When -m and -d are asked at the same time, ignore '-d', because
> '-d' will give duplicates for subsets of what '-m' would show
> anyway; and
There are other combination of options that need similar treatment,
e.g. '--cached --modified', '--cached --deleted', and I vaguely
remember a combination involving '--killed' as well.
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...
> * When neither -s nor -u is given, do not show the same path more
> than once, even the ones with multiple stages.
>
next prev parent reply other threads:[~2019-04-24 11:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-21 13:19 [PATCH/RFC] Makefile: dedup list of files obtained from ls-files Junio C Hamano
2019-04-22 3:23 ` Eric Sunshine
2019-04-22 6:11 ` Junio C Hamano
2019-04-22 14:49 ` Jeff King
2019-04-22 17:15 ` Ramsay Jones
2019-04-23 1:18 ` Junio C Hamano
2019-04-23 20:21 ` SZEDER Gábor
2019-04-24 1:03 ` Junio C Hamano
2019-04-24 11:25 ` SZEDER Gábor [this message]
2019-04-24 17:19 ` Eric Sunshine
2019-04-25 0:59 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190424112550.GC8695@szeder.dev \
--to=szeder.dev@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).