Re: git-checkout sometimes silently fails

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: git-checkout sometimes silently fails

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:34

Andrew Morton [off-list ref] writes:
y:/usr/src/git26> git-branch -av | grep '^\*'
* master               5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
y:/usr/src/git26> git-checkout linux-next    
Switched to branch "linux-next"
y:/usr/src/git26> git-branch -av | grep '^\*'
* linux-next           5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
So your two local branches 'master' and 'linux-next' both point at the
same commit, 5717922.

"git checkout <branchname>" is to check out the local branch name.  You
expect "git checkout master" and then "git checkout linux-next" to check
out two different commits because linux-next _should_ have been updated to
the latest from sfr repository.  But it appears to me that that is not the
case.

Perhaps "git fetch linux-next" hasn't been run, before "git checkout" was
attempted?

Re: git-checkout sometimes silently fails

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2016-06-15 22:44:34

On Tue, 06 May 2008 17:19:01 -0700 Junio C Hamano [off-list ref] wrote:
Andrew Morton [off-list ref] writes:
quoted
y:/usr/src/git26> git-branch -av | grep '^\*'
* master               5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
y:/usr/src/git26> git-checkout linux-next    
Switched to branch "linux-next"
y:/usr/src/git26> git-branch -av | grep '^\*'
* linux-next           5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
So your two local branches 'master' and 'linux-next' both point at the
same commit, 5717922.

"git checkout <branchname>" is to check out the local branch name.  You
expect "git checkout master" and then "git checkout linux-next" to check
out two different commits because linux-next _should_ have been updated to
the latest from sfr repository.  But it appears to me that that is not the
case.
I did a git-fetch of linux-next yesterday.
Perhaps "git fetch linux-next" hasn't been run, before "git checkout" was
attempted?
I reran `git-fetch linux-next' and that downlaoded a heap of stuff (perhaps
necause linux-next rebases every time?) and after this, `git-checkout
linux-next' gives me what I expect.

But how come I couldn't check out yesterday's linux-next?

Re: git-checkout sometimes silently fails

From: J. Bruce Fields <hidden>
Date: 2016-06-15 22:44:34

On Tue, May 06, 2008 at 05:19:01PM -0700, Junio C Hamano wrote:
Andrew Morton [off-list ref] writes:
quoted
y:/usr/src/git26> git-branch -av | grep '^\*'
* master               5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
y:/usr/src/git26> git-checkout linux-next    
Switched to branch "linux-next"
y:/usr/src/git26> git-branch -av | grep '^\*'
* linux-next           5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
So your two local branches 'master' and 'linux-next' both point at the
same commit, 5717922.

"git checkout <branchname>" is to check out the local branch name.  You
expect "git checkout master" and then "git checkout linux-next" to check
out two different commits because linux-next _should_ have been updated to
the latest from sfr repository.  But it appears to me that that is not the
case.

Perhaps "git fetch linux-next" hasn't been run, before "git checkout" was
attempted?
Might also be worth checking whether there happens to be a tag (or
something else?) named the same as one of the branches?  I remember the
public -mm git repo, for example, having a tag named "master".  Yuch.

Grepping through git-for-each-ref output might shed some light.

--b.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help