Tag: svn

Last Subversion repository decommissioned – at last!

Posted by – 01/10/2015

Today I completed the git migration of the last Subversion repository we still had online at Propus.

Nothing different from what we had done for all the rest, but this was an old repository, mostly with unmaintained code, modeled after “project-as-subdirectory” style… Good old days…

Two scripts – I am sure people can find somewhere else on the Internet – are worth pasting here:

First, I detected 3 revisions committed by root user. The first two matched the creation of first two projects (AKA directories), so I mapped the three of them to the same person (who had this bad habit of logging as root). It ended up I was wrong for the third revision: it was the beginning of a new project, but by a different person. Since the authors file maps one-to-one, “root” could only be one and the person.

So, after the migration, I just use filter-branch to fix that particular commit. Trivial, but worth a gist:

Lastly, there are some projects (mapped as subdirectories in the new git repo), that we’d like to split from the “archived” do keep using or adding to them. They will become active projects again. So, we cloned the whole repo again, and used filter-branch to the rescue:

Since that was the last Subversion repository still alive, I’d like to end this post with a thanks for all the years of good service! Time to move on…

Mandando pro Subversion algo que só existe no git

Posted by – 17/07/2009

Eu não sei bem por que tem pessoas que acham que eu sou um expert em git… Caras: só porque eu mantenho alguns projetos no GitHub não quer dizer que virei expert. Toda semana tem algum email para mim perguntanto alguma coisa sobre git… A maioria eu consigo responder já que é coisa básica (ou aponto para alguma documentação e pronto), mas ontem veio uma pergunta meio estranha: Como mandar para o subversion algo que, até o momento, só existe em git?

Essa é interessante… Até agora eu não tinha precisado disso: só estava usando o git para manter projetos que já tinham começado no subversion da empresa… Pesquisando um pouco e adaptando para o estilo de trabalhar da Propus, eis minha proposta:

bash$ cd /caminho/para/o/projetoX
bash$ svn mkdir https://servidor.svn/projetoX -m "Importando do Git"
bash$ svn mkdir https://servidor.svn/projetoX/trunk -m "Importando do Git"
bash$ git checkout -b svn
bash$ git svn init https://servidor.svn/projetoX -s
bash$ git svn fetch
bash$ git rebase trunk
(aqui eventualmente o git se "perde", e algum conflito é gerado. Nos
projetos em que isso aconteceu para mim, um "git add arquivo-com-conflito"
seguido de um "git rebase --continue" foi o suficiente).
bash$ git svn dcommit

Com isso você tem um branch chamado svn que vai espelhar o que está no subversion. A partir de então e só seguir mantendo o código no master (ou em algum branch que quiser), fazer o merge com o branch svn e mandar para cima com um git svn dcommit

Considering git…

Posted by – 23/04/2008

It has been some time since I’ve blogged about Subversion and how I was finding it useful. I’ve been using subversion and svk since about that time and I love it. Svk is really great and although it is more an off-line version control than a distributed one, it goes a long way for a former cvs user like myself. Lately, I’ve been considering git (isn’t everyone?).

It was not until I moved to my own hosting (thus having to maintain two subversion trees: the new one and my company’s old one) that the whole “having a central repository” started bothering me. Merging became complex, since now I have two “central” repositories, and while svk makes it a lot simpler (I just keep a mirror of the two repositories and use svk to merge between them), I began to realize that there should be a better way… I’ve watched (again) Linus’ git lecture at Google Tech Talks and decided I was going to try it.

First thing that called my attention was how easy it is to share a repository: just copy the .git directory somewhere public (an http server, for instance), and there you have it. This is much easier than configuring modules for apache, or configuring svnserve (and I’ve done that a lot in the past 3 years!).

For the subversion-only user (one that has never used svk), the carry-all-the-repository-with-you thing may sound strange, but with svk, I was used to “mirror” the repository, so that’s not an important change to me. I could not compare space utilization (and git is advertised for being more space-efficient) yet, but so far the git repositories seems to be a little smaller.

I already found it easy to branch using svk (in fact, I used to do that a lot), but git branching is really a plus! You can switch back and forth inside the same ‘working copy’ (actually I don’t think it’s correct to call that a working copy) and merging is rocket-fast! Maybe if svk could easily merge between two distinct users without requiring a subversion repository (think about the defunct svl), I would not have been trying git, but…

One thing that is really missing is the partial checkout. Actually I liked very much that svn/svk “feature”, and the clean and natural way which they treat directories and files. I understand git is designed with other priorities in mind, but, right now, that feels like missing to me. Maybe it’s just a svn/svk habit.

All in all, I found git very interesting… I am not ready to switch from svn/svk yet, but I’ll try git in small new projects and see if I can get used to it.