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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Brian Foster <hidden>
Date: 2016-06-15 22:45:29

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

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

From: Jeff King <hidden>
Date: 2016-06-15 22:45:29

On Wed, Oct 15, 2008 at 09:53:42AM +0200, Brian Foster wrote:
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help