threads / discuss / 15910

[Q] "status" of files in (a part of) the working tree

Subject: [Q] "status" of files in (a part of) the working tree

## tl;dr

2 messages between Oct 15, 2008 and Oct 16, 2008.

replies: 1people: 2as markdown or json

Brian Foster· Oct 15, 2008, 07:53 UTC · lore
Hello,
 For every file in a directory of my working tree,
 I want to obtain a quick "status" summary (ideally,
 recursively, i.e. descending into each sub-directory):
 E.g., not-tracked, latest modification is not in
 the index, latest modification is in the index,
 not-modified, and so on.  As a hypothetical example
 (`# comments' added to explain what the line means):
    $ git some-cmd
    ? foo      # not-tracked
    - bar      # tracked, not-modified
    M xyzzy    # tracked, last modification not-in-index
    I plover   # tracked, last modification in-the-index
     ...
    $ 
 The `git ls-files' command sort-of seems to almost do
 what I want, but not exactly.  For instance (this is
 written by hand but based on actual results):
    $ git version
    git version 1.6.0.2
    $ git ls-files --exclude-standard --others --modified --cached -t
    ? foo
    H bar
    H xyzzy
    C xyzzy
    ...
    $ 
 However, note that some files are listed twice (which
 is confusing for my purposes), and I'm uncertain I've
 specified all the magic to see all non-excluded files
 regardless of their "status".  Obviously, once I know
 the appropriate set of magic I should be able to write
 a filter to process the output and remove the unwanted
 duplicates, but I'm wondering if someone has a better
 suggestion?  Generalissimo Goggle didn't find any clews.
cheers!
	-blf-
-- 
“How many surrealists does it take to   | Brian Foster
 change a lightbulb? Three. One calms   | somewhere in south of France
 the warthog, and two fill the bathtub  |   Stop E$$o (ExxonMobil)!
 with brightly-coloured machine tools.” |      http://www.stopesso.com
Jeff King· Oct 16, 2008, 18:44 UTC · re: Brian Foster · lore

Re: [Q] "status" of files in (a part of) the working tree

On Wed, Oct 15, 2008 at 09:53:42AM +0200, Brian Foster wrote:
Show 15 quoted lines
>  For every file in a directory of my working tree,
>  I want to obtain a quick "status" summary (ideally,
>  recursively, i.e. descending into each sub-directory):
>  E.g., not-tracked, latest modification is not in
>  the index, latest modification is in the index,
>  not-modified, and so on.  As a hypothetical example
>  (`# comments' added to explain what the line means):
> 
>     $ git some-cmd
>     ? foo      # not-tracked
>     - bar      # tracked, not-modified
>     M xyzzy    # tracked, last modification not-in-index
>     I plover   # tracked, last modification in-the-index
>      ...
>     $ 
Check out this thread:
  http://thread.gmane.org/gmane.comp.version-control.git/97830/focus=98041

Hopefully Shawn will unveil his tool soon, and I expect there may be some discussion about the preferred format.

-Peff

← back to recent threads