From: "Avery Pennarun" <apenwarr@gmail.com>
To: "Matt Graham" <mdg149@gmail.com>
Cc: git@vger.kernel.org, "Eric Wong" <normalperson@yhbt.net>
Subject: Re: git reset --hard isn't resetting
Date: Fri, 8 Aug 2008 10:40:03 -0400 [thread overview]
Message-ID: <32541b130808080740q249cb0f6t4395cc2623e67c5a@mail.gmail.com> (raw)
In-Reply-To: <1c5969370808071806g1f989260n55a4b8bebfedb6e@mail.gmail.com>
On Thu, Aug 7, 2008 at 9:06 PM, Matt Graham <mdg149@gmail.com> wrote:
> On Wed, Aug 6, 2008 at 2:02 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
>> 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.
Hmm. Well, one possibly important thing is that if you take a diff
between the version before the old files were removed, and the version
after the new files were added, it will *look* like a rename because
git doesn't look at the intermediate revisions. And note that this
sort of thing will be happen if you "git checkout" the before and
after versions.
> 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.
Did your Linux machine import the data using git-svn, or did it clone
a repo from Windows that imported using git-svn?
I can imagine a situation where git-svn on Windows could get confused
and add the wrong filenames (although it would be kind of unlikely if
they really were removed in one revision, then readded in another; why
would git-svn even think about the old names in that case?). However,
there's no explanation for a Linux system introducing such a mistake,
since the two files are just unrelated as far as Linux is concerned.
> 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.
If your git-svn repo doesn't reflect *exactly* the set of files in
your real svn repo, then you've hit a pretty bad bug and you're almost
certainly going to have problems with dcommit. On the other hand,
you're unlikely to manage to screw up your svn repo, assuming the
files you deleted were the ones that weren't supposed to be there;
"extra deleting" them from svn wouldn't be dangerous. I'd expect git
svn dcommit to just fail with a weird error.
>> 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.
Since this seems virtually impossible, it would be nice if you could
double check your SVN repo to make sure the problem really doesn't
exist there in *any* version. It just doesn't seem likely that git
would have had this problem if the files were cleanly removed in one
revision, then added in a later one. I could imagine it if they were
renamed all in one revision, though, or if there was *ever* an svn
revision where both files existed at once. In all those cases we
effectively have a bug in git-svn, but at least in the latter cases
it's an explainable one :)
Beware that svn doesn't reliably sort its filename lists, so you might
find that two different files in the *same* directory are in totally
different places in the list; perhaps you missed a filename that way.
Good luck,
Avery
next prev parent reply other threads:[~2008-08-08 14:41 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
2008-08-08 14:40 ` Avery Pennarun [this message]
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=32541b130808080740q249cb0f6t4395cc2623e67c5a@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=mdg149@gmail.com \
--cc=normalperson@yhbt.net \
/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).