Speaking for myself, I am for switching to git given that
1. we don't loose the hg history when switching to git
2. there is a more comprehensive/easy-to-use GUI for windows available than for Mercurial
> 2. there is a more comprehensive/easy-to-use GUI for windows available than for Mercurial
Well, which one? Can it do hunk splitting on commit? Does it have good rebasing support?
> Can it do hunk splitting on commit?
TortoiseHG removed hunk selection in the new version, didn't they? (Thats why I reinstalled the [really] old version after testing the new)
> Well, I consider Git just as half-baked as Mercurial. I'm still really puzzled by having a VCS boast the importance of histories on one hand and promote liberal usage of "git rebase -i" on the other hand.
Given that the data structures underlaying git haven't changed in years (outside of perhaps a few additional fields and a more compact compression scheme), the tools to manipulate the data structures are able to do just about anything conveniently, and the UI is mostly friendly, I consider it fully baked. Git doesn't try to prevent history manipulation by limiting the tools, but by using cryptographic signatures and server access controls. Various people promote different work flows using git, but you don't count my using a mercurial extension and git to edit history that ends up in a mercurial repository as a design flaw of mercurial, which tries really hard to make history editing inconvenient, do you?
A few examples that I have run into recently:
* I often end up putting new functionality in merge patches because it would just be hard to seperate them out. It's a bit of functionality that was forced by the combination of stuff in both branches. That's only a part of the merge - it's more like a combination patch. How do I represent that? If I put it in the merge it's hard to later recombine it (say, squash it with a bugfix). If I put it seperately, I have to leave some idiotic state in the merge.
* The VCS should track rebasing and cherry-picking. If I rebase and squash my patches, remove something specific to my branch, send it upstream, and the same changes come back at me from there, the VCS shouldn't throw up.
* If I merge a change on one branch, then want to merge in another branch, I have to resolve the very same conflicts again. Why doesn't the VCS know that I merged these particular patches together already?
* And seriously, rebasing interactively over merges should work. I think I wanted to squash two merges - which didn't work.
VCS need to think about patches more independently. Branches aren't series of patches - they are patch sets that change over time. Tag series, so to speak. The patch graph itself has compatibility edges (as in darcs) as well as documenting properties between patches - what got merged how with what (both classic merge as well as "squashes"), what got signed by whom, these kinds of things. You should be able to make all that crypto-secure and decentralized without problems.
I can draw you some pictures at OCM if you want ;)
> I often end up putting new functionality in merge patches because it would just be hard to seperate them out. It's a bit of functionality that was forced by the combination of stuff in both branches. That's only a part of the merge - it's more like a combination patch. How do I represent that? If I put it in the merge it's hard to later recombine it (say, squash it with a bugfix). If I put it seperately, I have to leave some idiotic state in the merge.
Temporary idiocy isn't bad - you typically mostly need to examine past states to find out where a bug came from, so "building" and "not regressing" is enough. You can put a note in the commit message so nobody will wonder why the "idiotic state" is there, and put the features in the next commit.
> The VCS should track rebasing and cherry-picking. If I rebase and squash my patches, remove something specific to my branch, send it upstream, and the same changes come back at me from there, the VCS shouldn't throw up.
git rebase and merge mostly don't throw up, because they recognize when a patch is already applied, and simply skip it. I don't think you can do much better with version control support - what if upstream accidentally reverts your patch as part of a larger change or something? You would not want rebase to throw away your patch. One could argue that the assumption that git has to work well with plain patches that are transmitted by email is outdated nowadays, but I think the robustness against incomplete VCS metadata is nice.
> If I merge a change on one branch, then want to merge in another branch, I have to resolve the very same conflicts again. Why doesn't the VCS know that I merged these particular patches together already?
Git does. It's called "rerere", and I'm not quite sure why it's not enabled by default, but when it is, it automatically reuses previous conflict resolutions and presents you with a merged file you just have to mark as resolved.
> VCS need to think about patches more independently. Branches aren't series of patches - they are patch sets that change over time
Well, the basic data structure of git comes from the assumption that a commit represents a specific state of the working tree a developer actually had at some point. I think that's a nice property: It basically guarantees that when you check out a specific commit, you get what the committer of that commit had, not something that the VCS dreamed up. Of course, the committer often created that state by applying a patch or rebasing or something, so it isn't automatically a guarantee that the state is anything that actually existed for more than a second, but you can always create bad commits no matter which VCS you use.
A VCS that had patches as the basic data structure would leave me constantly scared that one of my patches would be mismanaged by the VCS so that it looked like I introduced a bug I didn't. With patch signing, you either have no more flexibility than git offers, or you risk making it seem like a patch you signed introduced a hidden back door via unfortunate interaction with a commit by the attacker.
The thing I missed most in HG was being able to do updates on file B when I had local changes on file A. Even though the update would not break anything, HG didn't allow that :(
>2. there is a more comprehensive/easy-to-use GUI for windows available than for Mercurial
You are still using a version below 2.0, I think 2.1 and above are pretty convenient to use.
So it should be better than that version and not some outdated one you're using, imo.
I am not against git nor hg, so do what you want :)
> Speaking for myself, I am for switching to git given that
> 1. we don't loose the hg history when switching to git
We don't; we'd use the same process I used when I did the hg-git bridge trial run a couple of months ago.
> 2. there is a more comprehensive/easy-to-use GUI for windows available than for Mercurial
I can't answer that, the only GUI features I used of TortoiseHg was the repository browser.
> We don't; we'd use the same process I used when I did the hg-git bridge trial run a couple of months ago.
Well, we could use the opportunity to do some history editing to fix up some hilarious author names and get rid of the extra hg information we wouldn't use anyway, and pretend the documentation was there from the start. (Which would make it easier for me to use git's graft feature to run blame on the documentation using my copy of the redwolf repository.)
As for a windows GUI, git-gui and gitk aren't that bad, and only really lacking (interactive) rebase support. For normal rebase, we can probably just accept some merge commits or use the gitk context menu, though that's a bit awkward and a non-intuitive multi-step process. The few people using mq or the hg interactive-rebase feature are probably able to do "EDITOR=wordpad git rebase -i origin/master" from git bash or pick the patches using gitk. Using these tools has the advantage of not needing to install anything extra and being able to get help here in the forum or in #openclonk-dev. They're not changing too much over time, cross-platform, and we have people familiar with them or who could figure them out from their command line knowledge.
Same is true for SmartGit, btw: I think we'd need to write a guide which of these many buttons are actually safe to press. And what the hell an "index" is.
Edit: Cause to be honest, the most-used use case for most of us is still the normal checkin into the repository (like svn commit/update) - I want that to be easy, then I am content.
> With Mercurial, I first commit, then "Pull with Rebase" and then Push.
I usually don't push directly, but to bitbucket first, have to rebase a second time and get torn apart. Yeah, repositories ftw...
> If rebase works so differently in Git, how would my workflow look like in Git then?
git commit
git pull --rebase
git push
My workflow looks like this:
git gui&
<commit with git gui one or more patches, edit/compile/test in between>
hg-to-git (a script using hg-git to pull from hg.openclonk.org via an intermediate hg repos)
git rebase -i hg/master (because I often have some patches I want to push and some that need further edits)
git push hg master (this opens up tortoisehg via a hook in the git repository in the hg repository)
The workflow with pure git would look like this:
git gui&
<commit, fetch from the shared repos in git gui>
git rebase -i origin/master
<push via git gui>
In other words, the only "missing piece" is a GUI rebase button, or ideally a complete interactive rebase GUI. But there's a merge button, and micro-merges aren't that bad.
[extensions]
hgext.bookmarks=
hgext.mq=
hgext.git=
[git]
intree = True
(I have the extensions enabled globally, but that should be equivalent.)
Then create a script that runs these commands:
#!/bin/bash
set -e
(
cd /path/to/your/hg/repository
hg pull -u || true
hg book -f -r default master
hg book -f -d stable-5.2 2> /dev/null || true
hg book -f -r stable-5.2 stable-5.2
hg book -f -d stable-5.1 2> /dev/null || true
hg book -f -r stable-5.1 stable-5.1
hg book -f -d controls 2> /dev/null || true
hg book -f -r Controls controls
hg book -f -d heavyresources 2> /dev/null || true
hg book -f -r heavy-resources heavyresources
hg gexport
)
git fetch origin
(I'm not quite sure how necessary the hg book commands are, but they work for me)
Run the script. Initial conversion with hg-git is slow and might take hours, but subsequent updates are tolerable. The script should fail with a no-git-repository-here error. Fix that with a
git clone /path/to/your/hg/repository /path/to/your/git/repository
Then edit /path/to/your/hg/repository/.git/hooks/post-receive (yes, that's a .git in your mercurial repository) and add these lines:
hg gimport
thg sync
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill