git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Leo Razoumov <slonik.az@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: status letters consistency in log and ls-files
Date: Fri, 26 Sep 2008 23:30:05 -0400	[thread overview]
Message-ID: <20080927033004.GA2477@coredump.intra.peff.net> (raw)
In-Reply-To: <ee2a733e0809262020l318b0ac3v560400d95a5ba2b7@mail.gmail.com>

On Fri, Sep 26, 2008 at 11:20:03PM -0400, Leo Razoumov wrote:

> >   git diff --name-status
> >
> >  will show you the modified and deleted files. But since you are using
> >  "-c" to show _all_ cached files, I think only ls-files can do that
> >  (since diff is, obviously, about files with differences).
> 
> Moreover, git diff would not show untracked files while git ls-files
> will include them and label '?'

Yes, but that is somewhat simpler to fix, since we know that they cannot
be part of the "git diff" output. That is, you can just append the "git
ls-files -v -o" output. Actually, since cached files use the 'H' tag
which doesn't conflict with git-diff, and since your goal was to combine
the multiple output anyway, I wonder if something like this would make
you happy:

  (
    git ls-files --exclude-standard -v -c -o &&
    git diff --name-status --cached
  ) |
  perl -e '
    my %h;
    while(<>) {
      chomp;
      my ($status, $name) = split / /, $_, 2;
      $h{$name} .= $status;
    }
    print "$h{$_} $_\n" foreach sort keys(%h);
  '

?

Personally, I find listing every cached file makes the output hard to
read, since any modified ones will be lost in the noise. But that is
what you said you wanted...

-Peff

      reply	other threads:[~2008-09-27  3:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 18:28 status letters consistency in log and ls-files Leo Razoumov
2008-09-26 22:45 ` Jeff King
     [not found]   ` <ee2a733e0809261624y72dcfb8fw7910feb2542f501c@mail.gmail.com>
     [not found]     ` <20080927002949.GA25586@coredump.intra.peff.net>
2008-09-27  3:20       ` Leo Razoumov
2008-09-27  3:30         ` Jeff King [this message]

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=20080927033004.GA2477@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=slonik.az@gmail.com \
    /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 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 NNTP newsgroup(s).