{"id":1624,"date":"2010-03-23T10:27:29","date_gmt":"2010-03-23T09:27:29","guid":{"rendered":"http:\/\/daniel.haxx.se\/blog\/?p=1624"},"modified":"2023-12-28T10:07:34","modified_gmt":"2023-12-28T09:07:34","slug":"curl-goes-git","status":"publish","type":"post","link":"https:\/\/daniel.haxx.se\/blog\/2010\/03\/23\/curl-goes-git\/","title":{"rendered":"curl goes git"},"content":{"rendered":"\n<p>Just a few days ago the curl project turned twelve years old, and I decided that it was time for us to ditch our <a href=\"https:\/\/daniel.haxx.se\/blog\/2008\/04\/14\/why-curl-sticks-with-cvs\/\">trusty old CVS setup<\/a> and switch over to use git instead for source code control.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Switch at All<\/h2>\n\n\n\n<p>I&#8217;ve been very content with CVS over the years and in our small project we don&#8217;t really have any particularly weird or high demands on the version control software.<\/p>\n\n\n\n<p>Lately (like in recent years) I&#8217;ve dipped my toes into various projects that have been using git, and more and more over time I&#8217;ve learned to appreciate the little goodies that git does that CVS simply cannot. I&#8217;m then not even speaking about branches or merges etc that git does a whole lot better and easier than CVS, I&#8217;m in fact even more in love with git&#8217;s way to ease handling with diffs sent by email and its great way of keeping track of authors separately from the committer etc. git am and git commit &#8211;author are simply two very handy tools missing in CVS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Git<\/h2>\n\n\n\n<p>So if we want to switch from CVS to another tool what would we chose? That wasn&#8217;t really the question in my case so I didn&#8217;t answer it. In my case, it was rather that I&#8217;ve been using git in several projects and it is used in some of the biggest projects I work with so it was some git&#8217;s features I wanted. I didn&#8217;t consider any of the other distributed version tools as quite frankly: they wouldn&#8217;t be much better for me than what CVS already is. I want to reduce the number of different tools I need, and I&#8217;m quite sure anyway that git is one of the top contenders even if I would do an actual comparison.<\/p>\n\n\n\n<p>So the choice to go git was quite selfish and done by me, but I felt that quite a few guys in the curl community supported this decision and very few actually believe remaining with CVS was a better idea.<\/p>\n\n\n\n<p>The fact that git itself uses <a href=\"https:\/\/curl.se\/libcurl\/\">libcurl<\/a> for its HTTP access of course also proves its good taste! \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How did the conversion go<\/h2>\n\n\n\n<p>Very easy and swiftly. First, as I mentioned above we never used branches much so we basically had a linear development with a set of tags. I did an rsync of the full repo to get a local copy to work with, then I ran &#8216;git cvsimport&#8217; on that to created a new repo. I did run it a couple of times to make sure I had done a correct mapping of all CVS user names to their git equivalents. Converting &gt;10 years of CVS commits took roughly 10 minutes on my desktop machine so it wasn&#8217;t that tedious even.<\/p>\n\n\n\n<p>Once I had a local repo created with all authors looking good, I simply followed the instructions on github.com on how to add a remote origin to a local branch and when I pushed to that, git sent off all commits ever made to curl to the remote repo now exposed to the world from <a href=\"https:\/\/github.com\/curl\/curl\">github.com<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright\"><a href=\"https:\/\/curl.haxx.se\/\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"110\" src=\"https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2007\/09\/curl-keywords300.jpg\" alt=\"cURL\" class=\"wp-image-64\" title=\"cURL\"\/><\/a><\/figure>\n<\/div>\n\n\n<p>When that part was done, I did a quick read on the &#8216;git help daemon&#8217; docs and 30 seconds later I had a local repo setup that is a mirror of the github one, so that users can still opt to get the code from haxx.se.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Unchanged work flow<\/h2>\n\n\n\n<p>Git allows different ways of working with the code, but I&#8217;ve decided that at least as a start we won&#8217;t change the way we work. I&#8217;ll offer all committers push rights to the master branch on the repository and we will simply all push to that, as our head development branch.<\/p>\n\n\n\n<p>We will prefer patches made with git format-patch sent to the mailing list, but as before you can still produce patches by diffing source code using extracted tarballs or whatever approach you prefer.<\/p>\n\n\n\n<p>All details on how to get the code for <a href=\"https:\/\/curl.se\/source.html\">curl using git<\/a> is available online.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a few days ago the curl project turned twelve years old, and I decided that it was time for us to ditch our trusty old CVS setup and switch over to use git instead for source code control. Why Switch at All I&#8217;ve been very content with CVS over the years and in our &hellip; <a href=\"https:\/\/daniel.haxx.se\/blog\/2010\/03\/23\/curl-goes-git\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">curl goes git<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,6],"tags":[33,141,257],"class_list":["post-1624","post","type-post","status-publish","format-standard","hentry","category-curl","category-floss","tag-curl-and-libcurl","tag-cvs","tag-git"],"_links":{"self":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/1624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/comments?post=1624"}],"version-history":[{"count":14,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/1624\/revisions"}],"predecessor-version":[{"id":23831,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/1624\/revisions\/23831"}],"wp:attachment":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media?parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/categories?post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/tags?post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}