threads / discuss / 23773

git-gui disagrees with git status

Subject: git-gui disagrees with git status

## tl;dr

7 messages between May 10, 2010 and May 11, 2010.

replies: 6people: 5as markdown or json

Bill Winspur· May 10, 2010, 21:32 UTC · lore
Using git version 1.6.0.4
- Created an eclipse wkspace, with a couple of projects in it.
- Created a git repos at the workspace route, using cli.
- Using cli added the two projects to git - at this point git status
shows the following
=====
bwinspur@elm:~/ca.wydv.
workspaces/008-leaning-group/git-lrng-wksp$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#    new file: git.trial.help.bundle/.classpath
        === omitted details from this post ==
#    new file: git.trial.ui.bundle/.classpath
        === omitted details from this post ==
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    .metadata/
bwinspur@elm:~/ca.wydv.workspaces/008-leaning-group/git-lrng-wksp$
=====

which is what I expected: my project folders are tracked, and .metadata/ is untracked.

- now I bring up git gui and it shows all the files under .metadata/ as
unstaged changes, which conflicts with git status, and may be due to a
git-gui bug
Regards,
Bill Winspur
Shawn O. Pearce· May 10, 2010, 21:39 UTC · re: Bill Winspur · lore

Re: git-gui disagrees with git status

Bill Winspur <bwinspur@gmail.com> wrote:
Show 14 quoted lines
> #
> # Untracked files:
> #   (use "git add <file>..." to include in what will be committed)
> #
> #    .metadata/
> bwinspur@elm:~/ca.wydv.workspaces/008-leaning-group/git-lrng-wksp$
> =====
> 
> which is what I expected: my project folders are tracked, and
> .metadata/ is untracked.
> 
> - now I bring up git gui and it shows all the files under .metadata/ as
> unstaged changes, which conflicts with git status, and may be due to a
> git-gui bug
Its more a feature.

git-gui shows all untracked files, recursively expanding any directories which contain untracked files. git status collapses them up. If you don't want to track a directory, maybe you should configure it in one of the many gitignore locations so neither git status nor git gui shows it.

-- 
Shawn.
Miles Bader· May 11, 2010, 05:41 UTC · re: Shawn O. Pearce · lore

Re: git-gui disagrees with git status

"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 5 quoted lines
> Its more a feature.
>
> git-gui shows all untracked files, recursively expanding any
> directories which contain untracked files.  git status collapses
> them up.
Wait, why is this a feature, exactly...?

It may be well known that git-gui works this way, but that doesn't make it good behavior for the user.

-Miles
-- 
"Suppose we've chosen the wrong god. Every time we go to church we're
just making him madder and madder." -- Homer Simpson
Johannes Sixt· May 11, 2010, 05:57 UTC · re: Miles Bader · lore

Re: git-gui disagrees with git status

Am 5/11/2010 7:41, schrieb Miles Bader:
Show 11 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
>> Its more a feature.
>>
>> git-gui shows all untracked files, recursively expanding any
>> directories which contain untracked files.  git status collapses
>> them up.
> 
> Wait, why is this a feature, exactly...?
> 
> It may be well known that git-gui works this way, but that doesn't make
> it good behavior for the user.

Oh, it *is* good behavior. Otherwise, it would not be possible to stage a file that resides in a currently untracked directory; you would have to fall back to 'git add' on the command line.

-- Hannes
Miles Bader· May 11, 2010, 06:27 UTC · re: Johannes Sixt · lore

Re: git-gui disagrees with git status

On Tue, May 11, 2010 at 2:57 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 14 quoted lines
>>> Its more a feature.
>>>
>>> git-gui shows all untracked files, recursively expanding any
>>> directories which contain untracked files.  git status collapses
>>> them up.
>>
>> Wait, why is this a feature, exactly...?
>>
>> It may be well known that git-gui works this way, but that doesn't make
>> it good behavior for the user.
>
> Oh, it *is* good behavior. Otherwise, it would not be possible to stage a
> file that resides in a currently untracked directory; you would have to
> fall back to 'git add' on the command line.

Since it's a GUI, though, it's allowed to use interaction -- so even _better_ behavior would be to only show unknown directories as single entries but allow the user to expand them interactively in the (probably rather rare) case that they want to add some file in an untracked directory.

-Miles
-- 
Do not taunt Happy Fun Ball.
Jonathan Nieder· May 11, 2010, 06:27 UTC · re: Johannes Sixt · lore

Re: git-gui disagrees with git status

Johannes Sixt wrote:
>> "Shawn O. Pearce" <spearce@spearce.org> writes:
Show 5 quoted lines
>>> Its more a feature.
>>>
>>> git-gui shows all untracked files, recursively expanding any
>>> directories which contain untracked files.  git status collapses
>>> them up.
[...]
> Oh, it *is* good behavior. Otherwise, it would not be possible to stage a
> file that resides in a currently untracked directory; you would have to
> fall back to 'git add' on the command line.

I would say rather it is the best we have. Much better would be to display untracked directories using a tree view (like gitk’s treeview), starting out collapsed[1].

Jonathan
[1] http://bugs.debian.org/572805
Jonathan Nieder· May 11, 2010, 14:27 UTC · lore

Re: git-gui disagrees with git status

[repopulating cc list]
Bill Winspur wrote:
> On Tue, May 11, 2010 at 8:04 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Bill Winspur wrote:
Show 5 quoted lines
>>> And, to avoid reverting to the command line, implement a GUI add of
>>> the currently
>>> selected untracked file to move untracked to tracked && staged.
>>
>> Doesn’t double-clicking do that?
[...]
> Replying to all:
> And, to avoid reverting to the command line, implement a GUI add of
> the currently selected untracked file to move untracked to tracked && staged.

Sorry for the lack of clarity. Adding CCs again, though I am still not sure I understand what you are asking for. Maybe you were hoping for a button rather than having to click the file icons. Whatever it was, I encourage you to play around with git-gui/git-gui.sh, after the create_common_diff_popup {} function.

Jonathan

← back to recent threads