threads / discuss / 19923

git-svn seems confused about current HEAD

Subject: git-svn seems confused about current HEAD

## tl;dr

3 messages between Jun 25, 2009 and Jul 3, 2009.

replies: 2people: 2as markdown or json

tom fogal· Jun 25, 2009, 00:00 UTC · lore

I've got a repository that git-svn won't grab the most recent commits for:

  tf@shigeru tuvok ~/sw/bin/git svn find-rev HEAD
  1164
  tf@shigeru tuvok ~/sw/bin/git svn fetch
  tf@shigeru tuvok ~/sw/bin/git --version
  git version 1.6.3.3
The repository is actually at revision 1184.  It's browsable online:
  https://gforge.sci.utah.edu/gf/project/Tuvok/scmsvn/
and publicly clonable:
  https://gforge.sci.utah.edu/svn/Tuvok

Interestingly, 1165 is also a commit which contains a string which is not representable in 8bit ASCII in the commit log. This is very likely to be the only such commit in the repository's history. After cloning, setting i18n.commitencoding and i18n.logoutputencoding to ISO-8859-1 and then trying another `git svn fetch' does not seem to have any effect.

Revisions 1166-1169 actually correspond to some commits I did to split a particular directory of that repository into another repository, and then add an svn:external for it. I did that via an svn checkout.

This is actually a `secondary' clone. In the clone I use to do daily work, I have somehow magically convinced my git repository that commits 116[56] do not exist. A contiguous snippet from `git log':

  commit 351dedb982af09e170b17001340208af46b197b5
  Author: tfogal <tfogal@c36c8488-0289-0348-9b64-b301f74bd9a7>
  Date:   Sat Jun 6 20:42:11 2009 +0000
      Use external `scio' repository.
      git-svn-id: https://gforge.sci.utah.edu/svn/Tuvok@1167
  c36c8488-0289-0348-9b64-b301f74bd9a7
  commit 401493d9175ebdb3c62d6524c701944f208aba94
  Author: tfogal <tfogal@c36c8488-0289-0348-9b64-b301f74bd9a7>
  Date:   Fri Jun 5 22:54:48 2009 +0000
      no newline at EOF issue.
      git-svn-id: https://gforge.sci.utah.edu/svn/Tuvok@1164
  c36c8488-0289-0348-9b64-b301f74bd9a7

I have no idea how I managed to do that, but it seems to have done the trick; I haven't noticed any issues with that clone, and I've apparently been working with it for a couple weeks now.

Is there a known workaround for this issue (or, how did I manage to `ignore' those commits in my initial repo)?

Thanks,
-tom
Eric Wong· Jul 2, 2009, 07:54 UTC · re: tom fogal · lore

Re: git-svn seems confused about current HEAD

tom fogal <tfogal@alumni.unh.edu> wrote:
Show 23 quoted lines
> I've got a repository that git-svn won't grab the most recent commits
> for:
> 
>   tf@shigeru tuvok ~/sw/bin/git svn find-rev HEAD
>   1164
>   tf@shigeru tuvok ~/sw/bin/git svn fetch
>   tf@shigeru tuvok ~/sw/bin/git --version
>   git version 1.6.3.3
> 
> The repository is actually at revision 1184.  It's browsable online:
> 
>   https://gforge.sci.utah.edu/gf/project/Tuvok/scmsvn/
> 
> and publicly clonable:
> 
>   https://gforge.sci.utah.edu/svn/Tuvok
> 
> Interestingly, 1165 is also a commit which contains a string which
> is not representable in 8bit ASCII in the commit log.  This is very
> likely to be the only such commit in the repository's history.  After
> cloning, setting i18n.commitencoding and i18n.logoutputencoding to
> ISO-8859-1 and then trying another `git svn fetch' does not seem to
> have any effect.

Wow, "svn log" seems to croak on 1165, too. How did you manage that? I guess SVN servers don't check for UTF-8 validity at all in the commits...

I would get your SVN administrator to propedit the r1165 log entry so people can see it in the future. Basically git svn relies on the library version of "svn log", so if "svn log" fails, then git svn usually has no chance of getting those revisions.

Show 29 quoted lines
> Revisions 1166-1169 actually correspond to some commits I did to split
> a particular directory of that repository into another repository, and
> then add an svn:external for it.  I did that via an svn checkout.
> 
> This is actually a `secondary' clone.  In the clone I use to do daily
> work, I have somehow magically convinced my git repository that commits
> 116[56] do not exist.  A contiguous snippet from `git log':
> 
>   commit 351dedb982af09e170b17001340208af46b197b5
>   Author: tfogal <tfogal@c36c8488-0289-0348-9b64-b301f74bd9a7>
>   Date:   Sat Jun 6 20:42:11 2009 +0000
> 
>       Use external `scio' repository.
> 
>       git-svn-id: https://gforge.sci.utah.edu/svn/Tuvok@1167
>   c36c8488-0289-0348-9b64-b301f74bd9a7
> 
>   commit 401493d9175ebdb3c62d6524c701944f208aba94
>   Author: tfogal <tfogal@c36c8488-0289-0348-9b64-b301f74bd9a7>
>   Date:   Fri Jun 5 22:54:48 2009 +0000
> 
>       no newline at EOF issue.
> 
>       git-svn-id: https://gforge.sci.utah.edu/svn/Tuvok@1164
>   c36c8488-0289-0348-9b64-b301f74bd9a7
> 
> I have no idea how I managed to do that, but it seems to have done
> the trick; I haven't noticed any issues with that clone, and I've
> apparently been working with it for a couple weeks now.

I think one of your clones worked for you because 1166 was the latest revision for you when you ran "git svn fetch", so the next time you ran "git svn fetch" it would've started exactly at 1166.

> Is there a known workaround for this issue (or, how did I manage to
> `ignore' those commits in my initial repo)?
Here's what I did when the initial clone got stuck at 1164:

# kill the revmap, it caches the max revision to start scanning # (if you're using using noMetadata you'll need to use dd or a # a hex editor and delete the last 24 bytes instead. $ rm .git/svn/git-svn/.rev_map.c36c8488-0289-0348-9b64-b301f74bd9a7

# Instead of attempting to scan starting at 1164, start at 1166 instead $ git svn fetch -r1166:HEAD

I was stuck on this problem for a while, too... 1165 seems unrepresentable at the moment because of the log message.

-- 
Eric Wong
tom fogal· Jul 3, 2009, 17:43 UTC · re: Eric Wong · lore

Re: git-svn seems confused about current HEAD

Hi all, just wanted to ACK and confirm that the recommended actions were sound.

Eric Wong <normalperson@yhbt.net> writes:
Show 18 quoted lines
> tom fogal <tfogal@alumni.unh.edu> wrote:
> > I've got a repository that git-svn won't grab the most recent commits
> > for:
> > 
> >   tf@shigeru tuvok ~/sw/bin/git svn find-rev HEAD
> >   1164
> >   tf@shigeru tuvok ~/sw/bin/git svn fetch
> >   tf@shigeru tuvok ~/sw/bin/git --version
> >   git version 1.6.3.3
> > 
> > The repository is actually at revision 1184.
> >
> > Interestingly, 1165 is also a commit which contains a string which
> > is not representable in 8bit ASCII in the commit log.
> 
> Wow, "svn log" seems to croak on 1165, too.  How did you manage that?  I
> guess SVN servers don't check for UTF-8 validity at all in the
> commits...

*shrug*, I just copy-and-pasted a contributor's name into the log. I think in the future, I'll leave their names in the code instead of the log :)

> I would get your SVN administrator to propedit the r1165 log entry
> so people can see it in the future.  Basically git svn relies on the
> library version of "svn log", so if "svn log" fails, then git svn
> usually has no chance of getting those revisions.

I think Eric was referring to `svnadmin setlog' here. We've done that and everything seems to be working well.

I'm slightly worried that I've rewritten history behind git's back -- I'm likening it to rebasing an upstream after pulling from it -- but everything seems okay so far without any gymnastics downstream. Perhaps it's not an issue because only a log message, and not actual code, has changed. *shrug*, for my case, re-cloning wouldn't be a disaster anyway.

> > Is there a known workaround for this issue (or, how did I manage to
> > `ignore' those commits in my initial repo)?
> 
> Here's what I did when the initial clone got stuck at 1164:
[snip]
Thanks much for the help!
-tom

← back to recent threads