From: "Matt Graham" <mdg149@gmail.com>
To: "Avery Pennarun" <apenwarr@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git reset --hard isn't resetting
Date: Thu, 7 Aug 2008 21:06:27 -0400 [thread overview]
Message-ID: <1c5969370808071806g1f989260n55a4b8bebfedb6e@mail.gmail.com> (raw)
In-Reply-To: <32541b130808061102q752076a8ydc02fef4e799491f@mail.gmail.com>
On Wed, Aug 6, 2008 at 2:02 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> On 8/6/08, Matt Graham <mdg149@gmail.com> wrote:
>> I'm using a git svn tree in Cygwin. I tried doing an svn rebase and
>> got in some weird state with local changes I can't get rid of. It's
>> not an issue w/ the same repository on my linux machine.
>>
>> git reset --hard
>> toggles 4 files between capitalization. The files don't appear to
>> have changed case in svn, but it's a huge repository and not easy to
>> determine with certainty.
>
> Try:
> git log --name-only
> to see which patches change which files. It's a virtual certainty
> that they were renamed in svn at some point.
They weren't "renamed". Further investigation w/ the hated svn tools
showed that the upper case was removed, then many commits later, the
lowercase was added.
> git doesn't handle case-munging filesystems perfectly, and gets into
> the situation you describe. First, you need to figure out whether you
> have files with *both* cases accidentally added to your index (if git
> reset toggles the capitalization, this is almost certainly the case):
>
> git ls-tree HEAD
>
> If you see the same files with different case, that's your problem.
Indeed that was the problem. In fact, l now noticed that my linux
machine has both versions as well. Being case sensitive, it didn't
mind and the problem wasn't obvious.
> Now just 'git rm' the ones with the case you don't want, and commit
> the result. (Do *not* use commit -a!) 'git status' will give you
> some funny messages indicating that files you *didn't* 'git rm' have
> gone away in the filesystem; it's true, of course, but don't worry
> about that. Now 'git reset --hard HEAD' and you should be okay.
This worked fine exactly as you said. I'm curious what will happen when I do
git svn dcommit
These aren't my files and I'm sort of using git svn on the sly. I'd
prefer to not have something weird happen to the svn repository due to
this. Due to the schedule, our tolerance for screwing things up b/c I
want to use git will be low. And my argument that we should have used
git from the outset probably won't help any.
> I'm not really sure what git should do better in this case, although
> the current behaviour is obviously a bit confusing.
Yes, if SVN is going to have both versions, it's understandable that
git wouldn't know what to do. Unfortunately, it looks like SVN only
had one version at a time. So it seems git somehow revived the
uppercase version when the lowercase one was readded through git svn.
This happened on both the cygwin and linux versions, although it only
caused an obvious problem on the cygwin version. I don't know git
well enough to speculate why this happened, but it looks like it's a
real bug that shouldn't have happened in this case.
On cygwin I'm using 1.5.5.1 and the repository only used that version.
On linux, I currently have 1.6.0.rc0.79.gb0320 but the repo may have
been originally cloned w/ earlier versions.
next prev parent reply other threads:[~2008-08-08 1:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 16:41 git reset --hard isn't resetting Matt Graham
2008-08-06 18:01 ` Dmitry Potapov
2008-08-06 18:02 ` Avery Pennarun
2008-08-08 1:06 ` Matt Graham [this message]
2008-08-08 14:40 ` Avery Pennarun
2008-08-09 8:08 ` Eric Wong
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=1c5969370808071806g1f989260n55a4b8bebfedb6e@mail.gmail.com \
--to=mdg149@gmail.com \
--cc=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
/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).