We are in the process of transitioning from subversion to git following the 
recipe in section 8.2 of the git book.

Our existing subversion is a large monolithic repository containing a large 
number of individual project folders - each of which contains the 
recommended trunk/tags/branches subfolders. I am creating a new git 
repository for each such project folder and in general it is working pretty 
well so far.

The main gotcha I have noticed is where a file has been moved between 
different projects in subversion - which happens relatively often as 
projects are restructured e.g. to allow code originally developed in one 
project to be shared with other projects by breaking it out into a shared 
dependent project etc.

To illustrate this simply I have created two new project folders in svn 
called "a" and "b" - each containing just a trunk - and checkout a working 
copy of each. I then create a file "file.txt" in "a" and commit it as 
"commit 1", make a change and commit again as "commit 2". Checking the 
history gives the expected output:

$ svn log file.txt 
------------------------------------------------------------------------
r6242 | geoff | 2013-05-03 09:49:45 +0100 (Fri, 03 May 2013) | 1 line

commit 2
------------------------------------------------------------------------
r6241 | geoff | 2013-05-03 09:49:29 +0100 (Fri, 03 May 2013) | 1 line

commit 1
------------------------------------------------------------------------

I now copy the file in the repo (using subclipse repository exploring view 
for convenience) from a/trunk to b/trunk as "commit 3". In my working copy 
of "b" I run svn update to retrieve the file, make a change, and commit as 
"commit 4". Again checking the history gives a sensible result:

$ svn log file.txt 
------------------------------------------------------------------------
r6244 | geoff | 2013-05-03 09:50:46 +0100 (Fri, 03 May 2013) | 1 line

commit 4
------------------------------------------------------------------------
r6243 | geoff | 2013-05-03 09:50:10 +0100 (Fri, 03 May 2013) | 1 line

commit 3
------------------------------------------------------------------------
r6242 | geoff | 2013-05-03 09:49:45 +0100 (Fri, 03 May 2013) | 1 line

commit 2
------------------------------------------------------------------------
r6241 | geoff | 2013-05-03 09:49:29 +0100 (Fri, 03 May 2013) | 1 line

commit 1
------------------------------------------------------------------------

I now create a new git repo based on project "b":

$ git svn clone http://[URL]/sandpit/svn-copy/b --authors-file=users.txt 
--no-metadata -s b-git
Initialized empty Git repository in /[PATH]/sandpit/svn-copy/b-git/.git/
Using higher level of URL: http://[URL]/sandpit/svn-copy/b => http://[URL]
W: Ignoring error from SVN, path probably does not exist: (160013): 
Filesystem has no item: File not found: revision 100, path 
'/sandpit/svn-copy/b'
W: Do not be alarmed at the above message git-svn is just searching 
aggressively for old history.
This may take a while on large repositories
r6240 = e9bf6af1176a516e8a08addc2b76b11eacf9c257 (refs/remotes/trunk)
A file.txt
r6243 = 1ff635b4923c6968ae56a97760a5a38173c0eb60 (refs/remotes/trunk)
M file.txt
r6244 = a612073ddc450ed68308629a25063dedc439807d (refs/remotes/trunk)
Checked out HEAD:
  http://[URL]/sandpit/svn-copy/b/trunk r6244

When I look at the resulting history it is incomplete:

$ cd b-git/
$ git log file.txt 
commit a612073ddc450ed68308629a25063dedc439807d
Author: Geoff Ballinger <[EMAIL]>
Date:   Fri May 3 08:50:46 2013 +0000

    commit 4

commit 1ff635b4923c6968ae56a97760a5a38173c0eb60
Author: Geoff Ballinger <[EMAIL]>
Date:   Fri May 3 08:50:10 2013 +0000

    commit 3

I am only seeing the history from the point of the copy - the commits from 
the original location have been lost.

Is there anything I can do about this or do we have to accept this as part 
of the cost of moving to git?

Thanks!,

Geoff.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to