azzurris / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

git status does not report commits ahead of remote #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: repo v1.6.9.1, git version 1.6.3.3
Environment: Ubuntu 9.10 (Karmic Koala)

What steps will reproduce the problem?
1. repo start topic project
2. cd project; echo hello > world; git add world; git commit -m "hello world"
3. git status

What is the expected output? What do you see instead?

Currently git status looks like this:
$ git status
# On branch topic
nothing to commit (working directory clean)

This tells me the clean/unclean status correctly but not the status
relative to the remote like a tracking branch is supposed to.

If I manually create the topic branch rather than use repo start:
$ git branch topic origin/master 
Branch topic set up to track remote branch master from origin.

And then repeat 2-3 above, I get:
$ git status
# On branch topic
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

This correctly shows that I've committed changes that are not on the remote.

Please provide any additional information below.

I think the root of this issue is that "repo start" does not setup the new
topic branch as a tracking branch quite correctly. When I "cat .git/config"
I see two different things:

How "repo start topic project" sets up things:
[branch "topic"]
        remote = origin
        merge = master

How "git branch topic origin/master" sets up things:
[branch "topic"]
        remote = origin
        merge = refs/heads/master

Apparently the missing refs/heads/ prefix is what makes the repo start not
work correctly. If I manually edit it to add the prefix, git status works
correctly.

Original issue reported on code.google.com by OdinG...@gmail.com on 6 Apr 2010 at 3:01