mainSavannah Administration - Support: sr #106896, Migration from CVS to git creates...

 
 

sr #106896: Migration from CVS to git creates too many branches

Submitter:  Heinrich Langos <hlangos>
Submitted:  Wed 17 Jun 2009 05:31:23 PM UTC
   
 
Category:  Source code repositories - developer access Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  Beuc
Operating System:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 23 Jun 2009 09:54:12 AM UTC, comment #3: 


> > * please remove "-b" from the cvs tag instructions
> > or document the lasting effects.
>
> This is a wiki, please do the latter :)


Done.
Sorry I didn't see the tiny list of wiki command links.
Is it possible to get a wiki as a "Feature" for projects ?
Like the Task Tracker feature?

> > * Do I need origin/origin at all?


Nope I don't.

> > o How can I remove it?


Found it.

git push origin :heads/origin


> > o How can I rename it to something like origin/cvs if
> > I decide that I need it for historical reasons or
> > upstream reasons?


Renaming can be done locally (i.e. before pushing) by

git branch -m oldname newname

or later by copying and removing the old branch.
see http://github.com/guides/rename-a-remote-branch

> > * Do I need origin/master?
>
> Looks like a question for the git mailing list rather than us.
> I'd say "yes, unless you want to inconvenience your users",
> but I could be wrong.


Turns out it is easier to just keep it :-)

> > * How do I clean out the remote git repository to start
> > over ? :-)
> That you need to ask us and we do it after validating you
> actually plan to put something back.


Already done it. I simply deleted all remote branches and
pushed again like there was nothing but an empty repository waiting. "git gc" will do the rest.
Behold the raw power of git ;-)

Heinrich Langos <hlangos>
Mon 22 Jun 2009 09:36:37 PM UTC, comment #2: 


>     * please remove "-b" from the cvs tag instructions or document the lasting effects.


This is a wiki, please do the latter :)

>     * Do I need origin/origin at all?
>           o How can I remove it?
>           o How can I rename it to something like origin/cvs if I decide that I need it for historical reasons or upstream reasons?


I'm not sure how it's used, but I'm pretty sure everybody else could do without :)

>     * Do I need origin/master?


Looks like a question for the git mailing list rather than us.
I'd say "yes, unless you want to inconvenience your users", but I could be wrong.

>     * How do I clean out the remote git repository to start over ? :-)


That you need to ask us and we do it after validating you actually plan to put something back.

Sylvain Beucler <Beuc>
Wed 17 Jun 2009 06:01:24 PM UTC, comment #1: 

I've found out how to delete remote branches:



git push ${login}@git.sv.gnu.org:/srv/git/${project}.git :heads/${branch2delete}


deleting the remote master however seems to have screwed up the repository.


warning: remote HEAD refers to nonexistent ref, unable to checkout.



Heinrich Langos <hlangos>
Wed 17 Jun 2009 05:31:23 PM UTC, original submission:  

I'll keep the project specific stuff out of the command lines that I give as I think it might interest other project administrators.

  • We want to switch from CVS to git.
  • My knowledge of git is that of a git user, not that of a git administrator.
  • Up until now CVS was used with only a few tags and no branches.


I followed the instructions on UsingGit .

First I tagged the CVS repository.

cvs tag -b repository-before-move-to-git


This irritatingly created a branch tag. So I think that "-b" should be removed from the example or explained as CVS tags are (almost) impossible to remove.

Then I used git-cvsimport to create a new git repository from the cvs:

git-cvsimport -A ../authors.txt -p x -v -d:${myrepository}:/sources/$project $module


This created a local git repository with two branches origin and master.

Then I pushed everything to the formerly empty project repository on savannah:


git push --tags -v ${login}@git.sv.gnu.org:/srv/git/${project}.git
git push --all -v ${login}@git.sv.gnu.org:/srv/git/${project}.git


Lastly I wanted to check out how this all would look for a new developer and I cloned the repository again to a new local directory:


git clone git://git.savannah.gnu.org/${project}.git


Now git-show-branch only shows the local master branch

[master] Description of the last commit.


but git-show-branch -a shows

* [master] Description of the last commit.
 ! [origin/HEAD] Description of the last commit.
  ! [origin/master] Description of the last commit.
   ! [origin/origin] Description of the last commit.
----
*+++ [master] Description of the last commit.


Looks to me like some of those remote branches are obsolete. I think at least the origin/origin branch could be either

  • removed (if the cvs repository will not be changed anymore) or
  • renamed to something like [origin/cvs-upstream] if cvs will remain the project's main VCS and git is just a convenience feature for some developers.


I don't know if origin/master is needed. I work on another project where there is no origin/master. Only origin/HEAD and "git pull" merges commits from origin/HEAD into my local master.

So here are the questions/actions:

  • please remove "-b" from the cvs tag instructions or document the lasting effects.
  • Do I need origin/origin at all?
    • How can I remove it?
    • How can I rename it to something like origin/cvs if I decide that I need it for historical reasons or upstream reasons?
  • Do I need origin/master?
  • How do I clean out the remote git repository to start over ? :-)


cheers
-h

Heinrich Langos <hlangos>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by Beuc (Posted a comment)
  • -email is unavailable- added by hlangos (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-22 Beuc StatusNone Done
        Assigned toNone Beuc
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code