threads / discuss / 20243

git-svn commit count vs- revision count

Subject: git-svn commit count vs- revision count

## tl;dr

5 messages between Jul 27, 2009 and Jul 27, 2009.

replies: 4people: 2as markdown or json

Tobi· Jul 27, 2009, 08:45 UTC · lore
Hi!

I've `git-svn clone`ed a pretty large repository, which took about 3 days even with with local access to the SVN repository. To check that everything went ok, I listed the root commits with `git fsck --root --full` and verfied, that these are indeed root commits with no branch point.

So far so good... what's puzzling me is, that `git rev-list --all | wc -l` says I have 40731 commits, but the SVN repository only has 21875 revisons.

Shouldn't these numbers be the same? The only explanation I have, is, that git-svn imported one or more branches or tags, where it failed to find the correct branch point in the history. Is there a way to figure out, if there went something wrong and possibly fix it?

Thx,
Tobias
Michael J Gruber· Jul 27, 2009, 09:59 UTC · re: Tobi · lore

Re: git-svn commit count vs- revision count

Tobi venit, vidit, dixit 27.07.2009 10:45:
Show 14 quoted lines
> Hi!
> 
> I've `git-svn clone`ed a pretty large repository, which took about 3 days
> even with with local access to the SVN repository. To check that
> everything went ok, I listed the root commits with `git fsck --root
> --full` and verfied, that these are indeed root commits with no branch point.
> 
> So far so good... what's puzzling me is, that `git rev-list --all | wc -l`
> says I have 40731 commits, but the SVN repository only has 21875 revisons.
> 
> Shouldn't these numbers be the same? The only explanation I have, is, that
> git-svn imported one or more branches or tags, where it failed to find the
> correct branch point in the history. Is there a way to figure out, if
> there went something wrong and possibly fix it?

With svn, it is possible to commit to (or create) several branches or tags in one go (i.e. revision), whereas with git those would be individual commits. For example, some people always create a commit and a tag "pointing" to it in one go in svn (commit to trunk and tags/foo). (The same is true for "svn style subprojects", i.e. subdirs used as subprojects.)

If that has been used to a large extent then it may explain the difference, although it is very large. Have you checked whether git-svn produced the (number of) branches and tags that you expect?

Michael
Tobi· Jul 27, 2009, 21:04 UTC · re: Tobi · lore

Re: git-svn commit count vs- revision count

> With svn, it is possible to commit to (or create) several branches or
> tags in one go (i.e. revision), whereas with git those would be
> individual commits.
I don't think this explains a difference of about 20000 commits.
> difference, although it is very large. Have you checked whether git-svn
> produced the (number of) branches and tags that you expect?

I can't exactly tell, if all the branches are correct, because a lot of the branches already have been merged and deleted in the SVN repository.

I checked the "git log --all" output with a small script to see, where multiple commits belong to the same SVN revision (according to the git-svn-id. Some SVN revions have up to 4 commits.

If I check some of these commits with `git branch --contains` then it seems only one of the commits belongs to branch.

Is it possible, that a commit doesn't belong to any branch?
Tobias
Tobi· Jul 27, 2009, 21:49 UTC · re: Tobi · lore

Re: git-svn commit count vs- revision count

> Is it possible, that a commit doesn't belong to any branch?
PS: gitk shows something like "Branches: many (43)" for such commits -
whatever this means...
Tobi· Jul 27, 2009, 22:13 UTC · re: Tobi · lore

Re: git-svn commit count vs- revision count

Tobi wrote:
> PS: gitk shows something like "Branches: many (43)" for such commits -
> whatever this means...
PPS: Ok - 1 second of thinking - of course it means, that this commit
belongs to 43 branches and I forgot the "-r" in "git branch --contains".
So all commits belong to branch.
But there are still SVN-Revions with up to 4 commits.

I checked the SVN logs of such revisons and it indeed seems to be the case, that these revisions update multiple branches. The number of touched branches per SVN commit still doesn't match the number of git-commits for this SVN revision, but it at least partially explains the high number of git commits compared to the svn revision count.

Tobias

← back to recent threads