[git-users] How to convert SVN tags to Git

2013-01-22 Thread Luís de Sousa
Dear all,

I have a basic SVN repo with a few tags marking code releases organised the 
following way:

/src
/releases
   /0.1
   /0.2
   /0.3
   

Where *src* is the trunk and all sub-folders of *releases* are tags created 
with *svn copy*. I've managed to migrate this repo using *git svn*, but the 
tags are not recognised as tags nor branches, git svn simply replicates the 
folder structure. I hape tried *svn2git*, but it doesn work on my 
system[1]. I've also tried some tutorials[2], but these don't seem to apply 
to my particular repo structure.

What would be correct procedure on this case? Thank you,

Luís

[1] https://github.com/nirvdrum/svn2git/issues/101
[2] http://john.albin.net/git/convert-subversion-to-git

-- 




[git-users] Re: How to convert SVN tags to Git

2013-01-22 Thread Thomas Ferris Nicolaisen
On Tuesday, January 22, 2013 11:11:00 AM UTC+1, Luís de Sousa wrote:

 Dear all,

 I have a basic SVN repo with a few tags marking code releases organised 
 the following way:

 /src
 /releases
/0.1
/0.2
/0.3


 Where *src* is the trunk and all sub-folders of *releases* are tags 
 created with *svn copy*. I've managed to migrate this repo using *git svn*, 
 but the tags are not recognised as tags nor branches, git svn simply 
 replicates the folder structure. I hape tried *svn2git*, but it doesn 
 work on my system[1]. I've also tried some tutorials[2], but these don't 
 seem to apply to my particular repo structure.

 What would be correct procedure on this case? Thank you,


Use the --tags parameter to specify where the tags are (relative to your 
clone url): http://www.kernel.org/pub/software/scm/git/docs/git-svn.html 

This will first turn them into git branches. Convert them into Git tags as 
explained here: http://thomasrast.ch/git/git-svn-conversion.html - under 
the section Changing tagging commits to tags

-- 




Re: [git-users] How to convert SVN tags to Git

2013-01-22 Thread Luís de Sousa
On Tuesday, 22 January 2013 13:10:02 UTC+1, Konstantin Khomoutov wrote:

 Hence git-svn creates one remote branch in your local repository for 
 each tag in the Subversion repository. 


Hi Konstatin, thanks for the reply.

As I wrote initially, *git svn clone* doesn't create any branches: 

$ git branch -r
  git-svn

Can these branches be created after the *clone* command?

Thank you,

Luís


-- 




Re: [git-users] How to convert SVN tags to Git

2013-01-22 Thread Konstantin Khomoutov
On Tue, 22 Jan 2013 04:53:30 -0800 (PST)
Luís de Sousa luis.a.de.so...@gmail.com wrote:

  Hence git-svn creates one remote branch in your local repository
  for each tag in the Subversion repository. 
[...]
 As I wrote initially, *git svn clone* doesn't create any branches: 
 
 $ git branch -r
   git-svn
 
 Can these branches be created after the *clone* command?

`git svn clone` is `git svn init` + `git svn fetch`, so I assume they
should be.  At least it worked for me several times I did conversions.
I think you should tinker with the options specifying repository layout,
such as --tags=  My Subversion repos always had standard layout
(as recommended in the book) so I used --stdlayout with
`git svn init`; in your case a more complicated setup is called for.

-- 




[git-users] Re: Trying to convert svn repos to Git repos

2013-01-22 Thread waas.nett

On Tuesday, January 22, 2013 12:11:19 PM UTC+1, Thomas Ferris Nicolaisen 
wrote:



 Yes. If it's possible in SVN, then it ideally should be handled by 
 git-svn. Just make sure you have the latest version of git to make sure 
 this hasn't been fixed in recent versions. It has at least been mentioned 
 on the mailing list at some point: 
 http://git.661346.n2.nabble.com/git-svn-and-subversion-1-7-testcase-failures-due-to-SVN-1-7-changes-td7256873.html

I am using Git 1.8.0 which is the last official release to my 
understanding. 
I cannot verify the problems with subversion as noted in that post. I can 
pull the version of the tag with subversion. However, as described before I 
had renamed it in subversion. However, also pulling the revision where the 
problem was introduced I can pull with subversion. BTW I am using 
TortoiseSVN 1.7.11 linked against subversion 1.7.8. 
So it seem to be limited to git-svn. 


  

 I had pulled a dump of the remote repos. I could remove the extra 
 white-space with an editor and even load the dump into a local repos. 
 Surprisingly this worked without a problem. Only the format issue came into 
 play at this point. I will file a report to the developers on the format 
 issue a bit later. 
 At the moment I am a bit po'ed about getting stuck with converting. I 
 need to make a decision to continue or stop and stay with svn. 


 Everything has costs and benefits. If moving to Git is not critical for 
 you, I'm sure the time can be well invested elsewhere.

I would label myself as pure user. Therefore, I am interested simply in 
using those tools.
Nevertheless, I was digging a bit more. The  Permission denied: Can't open 
'/tmp/report.tmp' : ... gives a line 1210 in SVN.pm. My clumsy conclusion 
is that this might be a problem of bash on top of windows. :-( 

-- 




Re: [git-users] Re: How to convert SVN tags to Git

2013-01-22 Thread Konstantin Khomoutov
On Tue, 22 Jan 2013 05:44:17 -0800 (PST)
Luís de Sousa luis.a.de.so...@gmail.com wrote:

[...]
 Now the issue is that I have no master branch, but all the oldre
 branches cloned. Can I just rename the most recent branch and delete
 the older branches?

This is a rather philosophical question.  The special treatment of the
trunk in Subversion and a branch named master in Git are just
examples of (common) policies, not enforced by the corresponding tools.

Hence you pick what *you* think should be your master and either fork
master off that branch (and delete it afterwards) or rename that
branch to master.

-- 




Re: [git-users] Storing extra files for release versions.

2013-01-22 Thread Konstantin Khomoutov
On Tue, Jan 22, 2013 at 10:14:12PM -0800, Rahul Gupta wrote:

 This is probably a hangover from SVN habits but still I would like the Git 
 way doing this.
 
 Normally using SVN, when I work on a latex file, I store the pdf generated 
 in my Tag folder along with latex file. There is no concept of Tag folder 
 in Git and while I want to store the PDF generated at each release-tag, I 
 do not want them in my project folders or to be tracked at all. What is the 
 best way of achieving this?

Git is able to keep in its database any object at all provided there is
a reference to it so that it's not garbage-collected.  A reference is,
typically, a branch or a tag.

To do that, use something like

$ git tag your-file.pdf $(git hash-object -w your-file.pdf)

The `git hash-object` program calculates the SHA-1 hash over your file,
writes the file to the database (-w) and prints that SHA-1 name to
stdout.  The `git tag` program accepts a tag name and the SHA-1 name of
an object the tag should reference and creates the tag.

After that, you are able to get the file out of your tag by doing

$ git show your-file.pdf your-file.pdf
or
$ git cat-file blob your-file.pdf your-file.pdf

--