Sonic and Sega Retro Message Board: Replacing svn with git/Mercurial - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 

Switch to git, switch to Mercurial (hg), or stay with Subversion (svn)?

1: Switch to git, switch to Mercurial (hg), or stay with Subversion (svn)?

  1. You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

Replacing svn with git/Mercurial

#1 User is offline FraGag 

Posted 15 June 2011 - 11:24 PM

  • Posts: 641
  • Joined: 09-January 08
  • Gender:Male
  • Location:Québec, Canada
  • Project:an assembler
  • Wiki edits:6
If you're reading this, you probably know what we couldn't commit to the svn repository for a while. Instead of figuring out how to keep the svn and WebSVN working all the time, I suggested that we switch to either git or Mercurial (hg). git and Mercurial use similar concepts that are quite different from svn, so there would be an adaptation period for those who have never used them, but then again, most of us probably learned svn through this project. :P

Both git and Mercurial are distributed version control systems. While with svn, the repository was stored on a server and all you had was a working copy, with DVCSes everybody has their own repository. This means that you can make local changes on your computer, commit them to your local repository to build a history, then you can push your changes to a central repository when you're ready to share them. You could also keep using git or Mercurial for your hack by committing your changes to your local repository without ever pushing them to the central repository. By committing regularly, you keep a version history and don't need to make manual back-ups in case you screw up with your hack; however, you'd still have to back up your repository or push it to a remote location in case your hard disk fails. (Technically, it would have been possible to use a local svn repository, but not with Retro's svn repository history.) Also, by building your hack in a repository, you can later pull changes made to Retro's repository and integrate them in your hack; if you edit very little code in your hack, the changes will most of the time be merged automatically.

And hopefully, the web access clients for git and Mercurial don't suck as much as WebSVN. :P

To help you make a choice between git and Mercurial, should you be asking yourself that question, here are some notes about them:
  • git is faster than Mercurial.
  • On Windows, git doesn't handle characters outside of ASCII (characters 0 to 127, for those who think ASCII is more than that) correctly in file names and commit messages: it reads them using the system's ANSI code page (e.g. CP1252) but then tries to interpret the bytes as UTF-8, which fails. This means that such characters would probably be rendered as ? or �. Mercurial also has this problem, but it can be fixed for the most part by using the fixutf8 extension (the only issue is when you try to create or clone a repository in a directory that contains characters outside of ASCII, in which case the repository will not be created correctly).
    EDIT: GerbilSoft made me notice utf8-git-on-windows, which aims to fix this problem.
  • git identifies revisions using a SHA-1 hash. Unlike svn, revision identifiers are not sequential. This wouldn't make sense anyway, because it is possible to create revisions in separate repositories and merge them together later on. Mercurial does this too, but it also uses sequential revisions numbers. However, these sequential numbers are only relevant in a specific repository, so they won't necessarily make sense in other repositories, even if they're all based on the same source repository.
  • Both have graphical clients on Windows. TortoiseGit is build from TortoiseSVN and tries to make git work like svn, which isn't necessarily a good thing... TortoiseHg, on the other hand, is completely different; it's really made for Mercurial. It's available as a Windows shell extension and as a GNOME/Nautilus extension.

This post has been edited by FraGag: 15 June 2011 - 11:50 PM

#2 User is offline Ollie 

Posted 16 June 2011 - 04:19 PM

  • DIGGY DIGGY HOLE
  • Posts: 1251
  • Joined: 28-May 06
  • Gender:Male
  • Location:Stoke-On-Trent, England, UK
  • Wiki edits:149
Git is the way forward! Would love to see that replace the SVN on here in the future especially if it's hard work to maintain it.

#3 User is offline Techokami 

Posted 16 June 2011 - 04:50 PM

  • For use only on NTSC Genesis systems
  • Posts: 1019
  • Joined: 19-November 05
  • Gender:Male
  • Location:HoleNet!
  • Project:Sonic Edge
  • Wiki edits:63
Seconding a vote for git.

#4 User is offline Aerosol 

Posted 16 June 2011 - 08:19 PM

  • FML
  • Posts: 6379
  • Joined: 27-April 08
  • Gender:Male
  • Location:New York
  • Project:Sonic (?): Coming summer of 2055...?
My vote probably means squat, but it's going towards git.

#5 User is offline Conan Kudo 

Posted 16 June 2011 - 09:15 PM

  • 「真実はいつも一つ!」工藤新一
  • Posts: 477
  • Joined: 12-January 09
  • Gender:Male
  • Wiki edits:14
I want to put for the case to replace Subversion with Mercurial:

With the platform diversity of the folks of Sonic Retro, I'd probably say that Mercurial is a better option, since it has been ported to many platforms and handles line endings a bit more gracefully than git does.

Mercurial is much easier to get a handle on, thanks to the trove of user guides available for it. For example, Hg Init is a tutorial site aimed at helping new VCS users and SVN users understand and get used to Mercurial. There's also a tutorial on Mercurial's official wiki, and a free official book on Mercurial.

TortoiseHg, after being rewritten to use Qt instead of GTK+, integrates much more cleanly into Windows Explorer than previous versions, and is very good at handling Unicode as well, since Qt has native UTF-8 support. And of course, TortoiseHg has a GNOME/Nautilus module, which no other TortoiseVCS variant has.

Mercurial requires no daemon program running in the background for the server repository to work, only that the repository configuration files are set properly. Mercurial will also shrink the total size of the repository many times over, because of the way the revlog works. It is also very easy to make a complete SVN import into Mercurial and preserve the entire repository history.

Mercurial is also quite fast on most platforms it runs on, whereas git unfortunately is not very fast on Windows because it relies heavily on UNIX style forking, which is emulated using either MSYS POSIX library or Cygwin POSIX library. Also, while git has gotten easier to use, it is still more cryptic and confusing than Mercurial.

Mercurial has been very well tested, with Mozilla/Mozdev, OpenJDK (Java), OpenOffice, OpenIndiana (OpenSolaris fork), Python, WiX, Enano CMS, and others relying on it for their projects, and having excellent reliability. Many of these projects chose Mercurial because it works very well in nearly all environments they develop under, be it Windows, Linux, Mac OS X, Haiku OS, or something else altogether!

Mercurial also has two free Visual Studio integration add-ins available: VisualHG (for MSVS 2005/2008/2010), and HgSccPackage (for MSVS 2008/2010). Integration with Eclipse, NetBeans, and other IDEs are available as well.

Some available web interfaces for Mercurial repositories are: phpHgAdmin, hgweb (included in Mercurial), TracMercurial, etc.

Maven, Redmine, and JIRA already include Mercurial support built-in.


#6 User is offline Scarred Sun 

Posted 16 June 2011 - 10:17 PM

  • Crushed by a single sunbeam
  • Posts: 3433
  • Joined: 06-February 05
  • Gender:Female
  • Location:San Francisco, CA
  • Project:Conquering the games industry
  • Wiki edits:36,091
I'm also on team hg for what it's worth.

#7 User is offline Andlabs 

Posted 17 June 2011 - 10:06 AM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
I don't care what we move to, but two things:

1) I don't know if we should keep the current folder-based system or split every project into its own repository. Would there be any advantages to either way? I know that if we go the latter, then everyone would only have what they need...
2) What about tying commits to users? Or is that not going to happen?

Then you have the problem of sharing code, though I don't know how to resolve that except keep everything together.
This post has been edited by Andlabs: 17 June 2011 - 10:07 AM

#8 User is offline Scarred Sun 

Posted 17 June 2011 - 10:38 AM

  • Crushed by a single sunbeam
  • Posts: 3433
  • Joined: 06-February 05
  • Gender:Female
  • Location:San Francisco, CA
  • Project:Conquering the games industry
  • Wiki edits:36,091
Tying commits to users would require us to either come up with some crazy hook that would intergrate with our databases (doubtful) or require every person who wanted to commit to have to ask for an account (annoying.)

Just saying.

#9 User is offline flamewing 

Posted 17 June 2011 - 10:38 AM

  • Elite Hacker
  • Posts: 675
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
QUOTE (FraGag @ Jun 16 2011, 01:24 AM)
If you're reading this, you probably know what we couldn't commit to the svn repository for a while. Instead of figuring out how to keep the svn and WebSVN working all the time, I suggested that we switch to either git or Mercurial (hg).

Out of curiosity, is there anything in git or Mercurial that would render them immune to the recent issue(s) we experienced with SVN? If yes, then I fully support the move, but I don't care which VCS is used (git or Mercurial). If git and Mercurial would fare no better, I don't care which VCS is used (git, Mercurial or SVN), and will use whatever is available.

#10 User is offline Andlabs 

Posted 17 June 2011 - 10:47 AM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
Simple: they're decentralized, so you have a copy of the repository that you can privately commit and then can push up to the server acting as the source. I'm not sure how conflicts are resolved, though...

Actually, there is no way we can continue to have the everything-in-one-asm-file approach if we go this route without edit conflicts up the ass if people decide to seriously work on these things. Sorry.
This post has been edited by Andlabs: 17 June 2011 - 10:48 AM

#11 User is offline Spanner 

Posted 17 June 2011 - 11:25 AM

  • Mako Retro
  • Posts: 2773
  • Joined: 02-June 07
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic the Hedgehog Hacking Contest, Other Stuff
  • Wiki edits:2,193
Jumping on the Mercurial bandwagon here. Whilst SVN has been a great advantage to many users here (and I'm not just covering the Retro SVN Project), Hg seems to be the better option compared to sticking with SVN, or jumping to Git. Plus, we need to have a system that can be used by many people, not just some.

#12 User is offline Conan Kudo 

Posted 17 June 2011 - 01:33 PM

  • 「真実はいつも一つ!」工藤新一
  • Posts: 477
  • Joined: 12-January 09
  • Gender:Male
  • Wiki edits:14
QUOTE (Andlabs @ Jun 17 2011, 10:47 AM)
Simple: they're decentralized, so you have a copy of the repository that you can privately commit and then can push up to the server acting as the source. I'm not sure how conflicts are resolved, though...

Actually, there is no way we can continue to have the everything-in-one-asm-file approach if we go this route without edit conflicts up the ass if people decide to seriously work on these things. Sorry.


In Mercurial, merging is usually done with "hg merge" and it will attempt to automatically merge files unless some edit differs at the same spot in the file being merged. Then Mercurial forces YOU to deal with it instead of having it try to do it and fail and make a horrible mess of things. Git handles it the same way. So does Bzr, and pretty much every other modern VCS developed in the last ten years.

It's bad development practice to keep everything in one ASM file, so you shouldn't be doing that anyway.

QUOTE (flamewing @ Jun 17 2011, 10:38 AM)
QUOTE (FraGag @ Jun 16 2011, 01:24 AM)
If you're reading this, you probably know what we couldn't commit to the svn repository for a while. Instead of figuring out how to keep the svn and WebSVN working all the time, I suggested that we switch to either git or Mercurial (hg).

Out of curiosity, is there anything in git or Mercurial that would render them immune to the recent issue(s) we experienced with SVN? If yes, then I fully support the move, but I don't care which VCS is used (git or Mercurial). If git and Mercurial would fare no better, I don't care which VCS is used (git, Mercurial or SVN), and will use whatever is available.


I'm not sure about git, but Mercurial would fare better because hgweb doesn't actually write humongous cache data all the time. And since there's no daemon running to keep a repository working in Mercurial, there isn't the overhead of another server caching in commits and writing them to the repository. This should also be true for git, but I'm not positive.

QUOTE (Scarred Sun @ Jun 17 2011, 10:38 AM)
Tying commits to users would require us to either come up with some crazy hook that would intergrate with our databases (doubtful) or require every person who wanted to commit to have to ask for an account (annoying.)

Just saying.


It might not be too difficult. One thing I've found that might help is something called SCM-Manager. It seems to support total user management for repos from the web interface. Its user auth system is extensible, and a plugin could be written to use the Retro user database and allow to specify which users are allowed to log in and push commits.
This post has been edited by Conan Kudo: 17 June 2011 - 01:57 PM

#13 User is online MainMemory 

Posted 19 June 2011 - 10:54 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3005
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
We should be polling the people that actually make commits to the SVN (myself, Andlabs, FraGag, Flamewing, Hivebrain, occasionally some others), because everybody else can use the web frontend if they just want to get the latest disassemblies.

Personally, I don't care much which way we go.
This post has been edited by MainMemory: 19 June 2011 - 10:57 AM

#14 User is offline Hivebrain 

Posted 19 June 2011 - 01:59 PM

  • Posts: 2326
  • Joined: 15-January 03
  • Gender:Male
  • Location:53.4N, 1.5W
  • Project:HivePal 2.0
  • Wiki edits:6,176
I prefer whichever is simplest to use, but as long as it's no more complicated than SVN, I don't mind.

#15 User is offline Overlord 

Posted 19 June 2011 - 03:07 PM

  • Что, вы ожидали что-то остроумное?
  • Posts: 13290
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
git & mercurial are BOTH more complicated than SVN from what I've read, and I looked into git as a possible replacement for svn for my own projects. Decided not to in the end. That said, as a single dev I don't need to worry so much about edit conflicts, which is what these two are more designed around...

  • 3 Pages +
  • 1
  • 2
  • 3
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users