From: Bryan Turner <bturner@atlassian.com>
To: Thomas Ackermann <th.acker@arcor.de>
Cc: worldhello.net@gmail.com, Git Users <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: Re: [Bug report] 'git status' always says "Your branch is up-to-date with 'origin/master'"
Date: Mon, 6 Jan 2014 01:48:49 -0700 [thread overview]
Message-ID: <CAGyf7-FX1sPjwvKdxeEXopffFPiftgDRqoe7NRWyM1Cm=5n6Sw@mail.gmail.com> (raw)
In-Reply-To: <1963290835.719443.1388996669450.JavaMail.ngmail@webmail15.arcor-online.net>
On 6 January 2014 01:24, Thomas Ackermann <th.acker@arcor.de> wrote:
>
>
> Hi Jiang,
>
> this happens with all of my repo clones (I am using V1.8.5.2
> on Windows and on Linux). Steps to reproduce:
>
> mkdir repo_a && cd repo_a && git init .
> echo "1">foo && git add foo && git commit -m "1"
> cd ..
> git clone repo_a repo_b
> cd repo_a
> echo "2">foo && git add foo && git commit -m "2"
> cd ../repo_b
> git status
> git checkout -b "branch"
> git checkout master
>
> 'git status' and 'git checkout master' in repo_b are now
> reporting "Your branch is up-to-date with 'origin/master'"
> which is obviously wrong.
>
Unfortunately that's not true. In repo_b your ref for origin/master
has not moved. It has remotely (meaning refs/heads/master in repo_a
has moved), but git status is not hitting the remote to find out; it
only looks at the local state. To see what I mean, run git fetch in
repo_b. Once you do that, you'll see that git status correctly reports
you're behind.
>
> ---
> Thomas
>
> ----- Original Nachricht ----
> Von: Jiang Xin <worldhello.net@gmail.com>
> An: Thomas Ackermann <th.acker@arcor.de>
> Datum: 06.01.2014 06:31
> Betreff: Re: [Bug report] 'git status' always says "Your branch is up-to-date
> with 'origin/master'"
>
> > 2014/1/5 Thomas Ackermann <th.acker@arcor.de>:
> > > Since f223459 "status: always show tracking branch even no change"
> > > 'git status' (and 'git checkout master' always says
> > > "Your branch is up-to-date with 'origin/master'"
> > > even if 'origin/master' is way ahead from local 'master'.
> >
> > Hi, Thomas
> >
> > Can you provide your operations so that I can reproduce this issue?
> >
> > In the commit you mentioned above, there was a new test case named
> > 'checkout (up-to-date with upstream)' added in 't6040'. I also add two
> > test-cases locally in order to reproduce the issue you report, and run
> > them in arbitrary orders, but they all look fine:
> >
> > ok 4 - checkout (behind upstream)
> > ok 5 - checkout (ahead upstream)
> > ok 6 - checkout (diverged from upstream)
> > ok 7 - checkout with local tracked branch
> > ok 8 - checkout (upstream is gone)
> > ok 9 - checkout (up-to-date with upstream)
> > ok 10 - checkout (upstream is gone)
> > ok 11 - checkout with local tracked branch
> > ok 12 - checkout (diverged from upstream)
> > ok 13 - checkout (ahead upstream)
> > ok 14 - checkout (behind upstream)
> > ok 15 - checkout (diverged from upstream)
> > ok 16 - checkout (upstream is gone)
> > ok 17 - checkout (ahead upstream)
> > ok 18 - checkout with local tracked branch
> > ok 19 - checkout (behind upstream)
> >
> >
> > The two additional test cases I used locally are:
> >
> > checkout_test1() {
> > test_expect_success 'checkout (behind upstream)' '
> > (
> > cd test && git checkout b3
> > ) >actual &&
> > test_i18ngrep "is behind .* by 1 commit, and can be
> > fast-forwarded" actual
> > '
> > }
> >
> > checkout_test_2() {
> > test_expect_success 'checkout (ahead upstream)' '
> > (
> > cd test && git checkout b4
> > ) >actual &&
> > test_i18ngrep "is ahead of .* by 2 commits" actual
> > '
> > }
> >
> > --
> > Jiang Xin
> >
>
> ---
> Thomas
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-01-06 8:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 8:24 Aw: Re: [Bug report] 'git status' always says "Your branch is up-to-date with 'origin/master'" Thomas Ackermann
2014-01-06 8:48 ` Bryan Turner [this message]
2014-01-06 9:04 ` Jiang Xin
2014-01-06 9:08 ` Aw: " Thomas Ackermann
2014-01-06 15:45 ` Jonathan Nieder
2014-01-06 16:00 ` Aw: " Thomas Ackermann
2014-01-06 17:12 ` Junio C Hamano
2014-01-14 23:34 ` Keshav Kini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGyf7-FX1sPjwvKdxeEXopffFPiftgDRqoe7NRWyM1Cm=5n6Sw@mail.gmail.com' \
--to=bturner@atlassian.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=th.acker@arcor.de \
--cc=worldhello.net@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).