All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Anders Melchiorsen" <mail@cup.kalibalik.dk>
Cc: git@vger.kernel.org
Subject: Re: [BUG] git ls-files -m --with-tree does double output
Date: Sun, 16 Nov 2008 00:03:58 -0800	[thread overview]
Message-ID: <7vr65c3xn5.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <57320.N1gUGH5fRhE=.1226617873.squirrel@webmail.hotelhot.dk> (Anders Melchiorsen's message of "Fri, 14 Nov 2008 00:11:13 +0100 (CET)")

"Anders Melchiorsen" <mail@cup.kalibalik.dk> writes:

> Junio C Hamano wrote:
>
>> What's the use case of using -m together with --with-tree to begin with?
>
> The script runs
>
>    git ls-files -d -m -o -t --with-tree=HEAD
>
> to get a parseable "git status"-like output. If I leave out
> --with-tree=HEAD, I do not get information about staged changes.

I think a machine parsable "status equivalent" is a good thing to have,
but I do not think the internal machinery of ls-files is equipped to do
that.  Didn't I send "here is how you would do it" patch some time ago, so
that interested parties can build on it to do that?

I lack the context to interpret what you mean by "The script", but in any
case, the only use case --with-tree was designed for was to use it in
conjunction with --error-unmatch inside the scripted version of "git
commit", to see if the paths given by the users make sense as a request to
create a partial commit.  It is not entirely surprising if any other funny
options do not work with it at all.

Having said all that, I think this would fix it.

 builtin-ls-files.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git c/builtin-ls-files.c i/builtin-ls-files.c
index b48327d..b28a185 100644
--- c/builtin-ls-files.c
+++ i/builtin-ls-files.c
@@ -227,6 +227,8 @@ static void show_files(struct dir_struct *dir, const char *prefix)
 			int dtype = ce_to_dtype(ce);
 			if (excluded(dir, ce->name, &dtype) != dir->show_ignored)
 				continue;
+			if (ce->ce_flags & CE_UPDATE)
+				continue;
 			err = lstat(ce->name, &st);
 			if (show_deleted && err)
 				show_ce_entry(tag_removed, ce);

  reply	other threads:[~2008-11-16  8:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 21:53 [BUG] git ls-files -m --with-tree does double output Anders Melchiorsen
2008-11-13 22:35 ` Junio C Hamano
2008-11-13 22:39   ` Junio C Hamano
2008-11-13 23:11   ` Anders Melchiorsen
2008-11-16  8:03     ` Junio C Hamano [this message]
2008-11-16  9:00       ` Anders Melchiorsen
  -- strict thread matches above, loose matches on Subject: below --
2008-09-24 16:19 Anders Melchiorsen
2008-09-26 22:50 ` Jeff King

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr65c3xn5.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mail@cup.kalibalik.dk \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.