# Re: Fwd: git status options feature suggestion

2 messages from 2008-10-12 to 2008-10-18. Participants: Leo Razoumov, Fyn Fynn.
Thread: https://gitlist.dev/t/15866

## Leo Razoumov, 2008-10-12 10:09

Subject: Re: Fwd: git status options feature suggestion
Message-ID: <ee2a733e0810120309o1fbfa4dxe6f2292a28bd6db3@mail.gmail.com>
URL: https://gitlist.dev/e/ee2a733e0810120309o1fbfa4dxe6f2292a28bd6db3%40mail.gmail.com

```
On 10/12/08, Junio C Hamano <gitster@pobox.com> wrote:
> [..snip..]
> I was going to suggest the same.  "git st" for people who come from "svn st"
>  so that "git status" can be kept as traditional "preview of 'git commit'".
>
>  And just make it mimic whatever folks accustomed to "svn st" would expect,
>  modulo we would need two status letters to signal difference between
>  (HEAD, index), and (index, worktree).  Perhaps three if you want to show
>  difference between (HEAD, worktree) while at it.
>
>  And no, I have not seen any argument good enough to change ls-files nor
>  diff-$lowlevel output and break people's existing scripts.
>

Please, at least introduce a new option (--status-letters)  that makes

git log --name-status
git diff --name-status
git ls-files -v

to use consistent letters to indicate the status. For details, see
recent discussion
http://www.spinics.net/lists/git/msg81141.html

Thanks,
--Leo--

```

## Fyn Fynn, 2008-10-18 00:19

Subject: Re: Fwd: git status options feature suggestion
Message-ID: <1a04eebf0810171719r6b604a88n781bf43f0f047aae@mail.gmail.com>
URL: https://gitlist.dev/e/1a04eebf0810171719r6b604a88n781bf43f0f047aae%40mail.gmail.com
In-Reply-To: <ee2a733e0810120309o1fbfa4dxe6f2292a28bd6db3@mail.gmail.com>

```
Just wanted to chime in about a feature existing in Bazaar's and
Subversion's and  "status" command: getting the status of tracked
files _only_.

Here's how the status -V switch works in Bazaar:

~/foo$ bzr init
~/foo$ echo "content" > bar.txt
~/foo$ bzr add bar.txt
added bar.txt
~/foo$ echo "content" > baz.txt
~/foo$ bzr status
added:
  bar.txt
unknown:
  baz.txt
~/foo$ bzr status -V
added:
  bar.txt

As you can see, the -V switch makes `bzr status` only display the
status of files that are tracked.

This is very useful when you're tracking a "skeleton" of essential
files in a directory tree that contains a large number of additional
files and subdirectories, particularly if those are changing often and
/ or are large/binary so it's impractical to control/ignore them.

A common case of that: tracking a subset of configuration files under
one's home directory.

Right now, there are two ways of getting around the lack of "status
-V" (Subversion: "status -q") in git (credit for both goes to doener
on #git@FreeNode, who showed them to me):

git config --global alias.st 'diff --name-status HEAD'

Which makes `git st` output practically the same thing as  -V/-q in
Bazaar/Subversion. However, the output doesn't distinguish between
Staged (indexed) and Unstaged (non-indexed) changes (a distinction
that the 2 other SCMs above don't support).


git config --global alias.st '!echo Staged:; git diff --cached
--name-status; echo Unstaged:; git diff --name-status'

Which does distinguish between Staged and Unstaged, but is definitely
something that can work only as an alias for frequent usage.

Incidentally, a minor quibble with both solutions is that they require
HEAD to exist; so you need to make at least one commit before you can
use them. For most users, this wouldn't frequently be a huge loss, but
if you're commonly initializing branches, you might miss it. For
example, note how the above Bazaar example would fail with:

fatal: ambiguous argument 'HEAD': unknown revision or path not in the
working tree.

- Fyn

```
