[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