git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git checkout branch puzzle
@ 2010-05-01 17:55 Chris.Cheney
  2010-05-02  4:59 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Chris.Cheney @ 2010-05-01 17:55 UTC (permalink / raw)
  To: git

I have been using msysgit (curently 1.7.0.2.msysgit.0) for about 18 months 
and thought that I had managed to understand most things. However, the 
following sequence has me baffled:

a) on branch 'master', git status shows that the working directory is clean

b) git checkout HEAD^ gives the usual moan about moving to a head which 
isn't a local branch

c) git checkout master followed by git status gives "changed but not 
updated" and a list of "modified" files

d) git reset --hard does not change the situation

I suspect the situation arose as a result of 'mv'ing some files without 
using git mv, but the resulting state above seems unreasonable.

Any explanation of (c)/(d) would be appreciated.

As a result, I have started using git add -A rather than got add . (and 
wonder why it isn't documented as the default thing to do).

TIA for any light on this.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git checkout branch puzzle
  2010-05-01 17:55 git checkout branch puzzle Chris.Cheney
@ 2010-05-02  4:59 ` Jeff King
  2010-05-02  8:58   ` Chris.Cheney
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff King @ 2010-05-02  4:59 UTC (permalink / raw)
  To: Chris.Cheney; +Cc: git

On Sat, May 01, 2010 at 05:55:47PM +0000, Chris.Cheney wrote:

> I have been using msysgit (curently 1.7.0.2.msysgit.0) for about 18 months 
> and thought that I had managed to understand most things. However, the 
> following sequence has me baffled:
> 
> a) on branch 'master', git status shows that the working directory is clean
> 
> b) git checkout HEAD^ gives the usual moan about moving to a head which 
> isn't a local branch
> 
> c) git checkout master followed by git status gives "changed but not 
> updated" and a list of "modified" files

Part (c) shouldn't show anything in "git status". I wonder if it is a
line-ending conversion issue, since you are using msysgit, and since
that is the usual culprit for files mysteriously looking changed. Might
you have recently changed the settings of core.autocrlf?

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git checkout branch puzzle
  2010-05-02  4:59 ` Jeff King
@ 2010-05-02  8:58   ` Chris.Cheney
  2010-05-02 20:09     ` Chris.Cheney
  0 siblings, 1 reply; 7+ messages in thread
From: Chris.Cheney @ 2010-05-02  8:58 UTC (permalink / raw)
  To: git

Jeff King <peff@peff.net> wrote in
news:20100502045901.GD14776@coredump.intra.peff.net: 

> On Sat, May 01, 2010 at 05:55:47PM +0000, Chris.Cheney wrote:
> 
>> I have been using msysgit (curently 1.7.0.2.msysgit.0) for about 18
>> months and thought that I had managed to understand most things.
>> However, the following sequence has me baffled:
>> 
>> a) on branch 'master', git status shows that the working directory is
>> clean 
>> 
>> b) git checkout HEAD^ gives the usual moan about moving to a head
>> which isn't a local branch
>> 
>> c) git checkout master followed by git status gives "changed but not 
>> updated" and a list of "modified" files
> 
> Part (c) shouldn't show anything in "git status". I wonder if it is a
> line-ending conversion issue, since you are using msysgit, and since
> that is the usual culprit for files mysteriously looking changed.
> Might you have recently changed the settings of core.autocrlf?
> 
> -Peff
> 

Thanks for the reply and confirming what I believed about (c). 

It is possible that what you suggest might be involved - it's a 2-developer 
situation, each using msysgit with their own local repository and a remote 
master (bare) repository. I'll compare the other's config file against 
mine.

Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git checkout branch puzzle
  2010-05-02  8:58   ` Chris.Cheney
@ 2010-05-02 20:09     ` Chris.Cheney
  2010-05-03  6:40       ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Chris.Cheney @ 2010-05-02 20:09 UTC (permalink / raw)
  To: git

"Chris.Cheney" <chris.cheney.nospam@tesco.net> wrote in
news:Xns9D6C65C2DB06EChrisCheneytesconet@80.91.229.10: 

> Jeff King <peff@peff.net> wrote in
> news:20100502045901.GD14776@coredump.intra.peff.net: 
> 
>> On Sat, May 01, 2010 at 05:55:47PM +0000, Chris.Cheney wrote:
>> 
>>> I have been using msysgit (curently 1.7.0.2.msysgit.0) for about 18
>>> months and thought that I had managed to understand most things.
>>> However, the following sequence has me baffled:
>>> 
>>> a) on branch 'master', git status shows that the working directory
>>> is clean 
>>> 
>>> b) git checkout HEAD^ gives the usual moan about moving to a head
>>> which isn't a local branch
>>> 
>>> c) git checkout master followed by git status gives "changed but not
>>> updated" and a list of "modified" files
>> 
>> Part (c) shouldn't show anything in "git status". I wonder if it is a
>> line-ending conversion issue, since you are using msysgit, and since
>> that is the usual culprit for files mysteriously looking changed.
>> Might you have recently changed the settings of core.autocrlf?
>> 
>> -Peff
>> 
> 
> Thanks for the reply and confirming what I believed about (c). 
> 
> It is possible that what you suggest might be involved - it's a
> 2-developer situation, each using msysgit with their own local
> repository and a remote master (bare) repository. I'll compare the
> other's config file against mine.

Neither of our config files contain autocrlf settings, but it's something 
that I'll look further into. Neither of us had made recent config changes.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git checkout branch puzzle
  2010-05-02 20:09     ` Chris.Cheney
@ 2010-05-03  6:40       ` Jeff King
  2010-05-03  8:06         ` Chris.Cheney
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff King @ 2010-05-03  6:40 UTC (permalink / raw)
  To: Chris.Cheney; +Cc: git

On Sun, May 02, 2010 at 08:09:32PM +0000, Chris.Cheney wrote:

> > Thanks for the reply and confirming what I believed about (c). 
> > 
> > It is possible that what you suggest might be involved - it's a
> > 2-developer situation, each using msysgit with their own local
> > repository and a remote master (bare) repository. I'll compare the
> > other's config file against mine.
> 
> Neither of our config files contain autocrlf settings, but it's something 
> that I'll look further into. Neither of us had made recent config changes.

I believe autocrlf is on by default for msysgit. But if there is nothing
in your config, then probably nothing changed. If you can reproduce the
situation, it might be worth narrowing down a simple test case and
posting the exact commands and output.

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git checkout branch puzzle
  2010-05-03  6:40       ` Jeff King
@ 2010-05-03  8:06         ` Chris.Cheney
  2010-05-06 20:30           ` Chris.Cheney
  0 siblings, 1 reply; 7+ messages in thread
From: Chris.Cheney @ 2010-05-03  8:06 UTC (permalink / raw)
  To: git

Jeff King <peff@peff.net> wrote in
news:20100503064053.GA20002@coredump.intra.peff.net: 

> On Sun, May 02, 2010 at 08:09:32PM +0000, Chris.Cheney wrote:
> 
>> Neither of our config files contain autocrlf settings, but it's
>> something that I'll look further into. Neither of us had made recent
>> config changes. 
> 
> I believe autocrlf is on by default for msysgit. But if there is
> nothing in your config, then probably nothing changed. If you can
> reproduce the situation, it might be worth narrowing down a simple
> test case and posting the exact commands and output.

Thanks. Indeed, after asking here, that was to be my next step - I need to 
restock up on round tuits :-)

FWIW My money is on a rm/git-rm or a mv/git-mv "user" error.

Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git checkout branch puzzle
  2010-05-03  8:06         ` Chris.Cheney
@ 2010-05-06 20:30           ` Chris.Cheney
  0 siblings, 0 replies; 7+ messages in thread
From: Chris.Cheney @ 2010-05-06 20:30 UTC (permalink / raw)
  To: git

"Chris.Cheney" <chris.cheney.nospam@tesco.net> wrote in
news:Xns9D6D5CD466CE2ChrisCheneytesconet@80.91.229.10: 

> Jeff King <peff@peff.net> wrote in
> news:20100503064053.GA20002@coredump.intra.peff.net: 
> 
>> On Sun, May 02, 2010 at 08:09:32PM +0000, Chris.Cheney wrote:
>> 
>>> Neither of our config files contain autocrlf settings, but it's
>>> something that I'll look further into. Neither of us had made recent
>>> config changes. 
>> 
>> I believe autocrlf is on by default for msysgit. But if there is
>> nothing in your config, then probably nothing changed. If you can
>> reproduce the situation, it might be worth narrowing down a simple
>> test case and posting the exact commands and output.
> 
> Thanks. Indeed, after asking here, that was to be my next step - I
> need to restock up on round tuits :-)
> 
> FWIW My money is on a rm/git-rm or a mv/git-mv "user" error.

I would have lost my money.

You were almost spot-on. It turned out that my remote collaborator was 
using a version of msysgit prior to the default of autocrlf being true.

We'll be recloning from a freshly built repository r.s.n.

Thanks for your help

Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-05-06 20:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-01 17:55 git checkout branch puzzle Chris.Cheney
2010-05-02  4:59 ` Jeff King
2010-05-02  8:58   ` Chris.Cheney
2010-05-02 20:09     ` Chris.Cheney
2010-05-03  6:40       ` Jeff King
2010-05-03  8:06         ` Chris.Cheney
2010-05-06 20:30           ` Chris.Cheney

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).