Steps to Reproduce:
.gitignore) without staging it.Current behavior: At the left side, the git modifications icon will have a (1) number to indicate one change to the repository.
Preferred new behavior as an option: don't count untracked files for this summary icon.
Sometimes there are legitimate reasons to have untracked files which are not part of .gitignore within a git dir. Maybe it's a temporary test, or a todo list, etc - it really depends on personal workflows.
On such cases, and especially if there are few such untracked files, the icon summary number becomes much less useful because it's always displaying some number, and it makes it quite harder, or even impractical, to glance and infer how many actual changes there are to files which _are_ tracked.
Obviously, depending on workflow, some may also prefer that the summary number does count untracked files.
Therefore, I suggest to add an option to control if they're counted or not, and up to you if you want to generalize it further to control counting of other kinds of modifications.
As an example of an unrelated summary which ignores untracked files by default: git's own git-prompt (at the contrib dir) will only have the prompt "modified" indicator for untracked files if the user specifically set GIT_PS1_SHOWUNTRACKEDFILES=1, but by default it will ignore untracked files.
I think it would be useful to allow such behavior for VSCode's summary icon too.
A setting is fine by me. Want to contribute a PR?
I don't have enough time now to familiarize myself with VSCode development. So if you feel it's at a reasonable place at the project's TODO list then I'd leave it to you (or anyone else who wants to have a go).
On the other hand, if it's a low priority and nobody handles it for weeks, then maybe at some stage I'd give it a go myself.
@avih @joaomoreno Mind if I give this a try?
Enjoy :)
I will, thanks 馃槈
With the latest insiders build, I can confirm that using "git.countBadge": "tracked", works as expected (I guess the name/behavior was improved after the merge. I like it).
This issue can be closed as far as I'm concerned. Thanks!
I know it should probably be a new issue or issues, but it's a similar subject so I'll post it here first.
I think the git "status"(?) string at the bottom left at the status bar could also benefit from similar control. Possibly even more control since it allows more than just a number. Here, too, I'd think git-prompt and its behavior and configuration variables could serve as a useful example. It looks like it already offers a fixed simple version of it, though here too it seems to unconditionally count untracked files as changes (I'm assuming that's what the * is).
It could probably also be useful to have a tooltip which could contain info such as "2 commit behind, 3 commits ahead of upstream, 2 staged files/deletions, 3 unstaged modified files, [5 untracked files]". Maybe the same info could also be added to the git badge tootip.
FWIW, with git-prompt it could (depending on config) be displayed as my-branch *+ u+3-2 (if HEAD is the same as upstream it would be u=)
I'm not sure to what extent you want to allow such control, so let me know which of those should be filed as a new issue, if at all.
Not sure... would you configure it if given the chance?
I probably would. I have configured git-prompt and find it very useful when working with git from the command line.
But that's me, and I realize different people have different priorities. Most would just use whatever defaults are provided. That's why I asked first if you want an issue filed for it.
What I can suggest, if others want to check if they find this kind of summary useful, is to enable git-prompt in their bash prompt, by adding this to ~/.bashrc (this is pretty much the default prompt of git for windows, with the added git summary configured to my liking):
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUPSTREAM="verbose"
GIT_PS1_SHOWCOLORHINTS=1
# These are also supported:
#GIT_PS1_SHOWSTASHSTATE=1
#GIT_PS1_SHOWUNTRACKEDFILES=1
# this might be elsewhere on other systems, or possibly not even required
source /mingw64/share/git/completion/git-prompt.sh
PROMPT_COMMAND='__git_ps1 "\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]\033[m" "\[\033[0m\]\n$ "'
And judge for themselves.
Thanks for this! "git.countBadge": "tracked", is great. :D
Most helpful comment
Thanks for this!
"git.countBadge": "tracked",is great. :D