This is a little success story. I thought I'd post it to encourage other people to try Mike's tree via git.
I just started using git so I could track Mike McCormack's tree. I first followed the instructions at http://wiki.winehq.org/GitWine to get a winehq tree, then followed Mike's instructions at http://www.winehq.org/pipermail/wine-devel/2006-April/047208.html to grab the latest changes.
The commands I used on my Ubuntu box were, all in all:
sudo apt-get install git-core git-doc git clone git://source.winehq.org/git/wine.git wine-git cat > .git/remotes/mmbranch <<EOF URL: http://mandoo.dyndns.org/wine.git Pull: refs/heads/master:refs/heads/mmbranch EOF git fetch mmbranch git pull . mmbranch
Everything went smoothly; it was rather fabulous. Then I ran into a regression, and wanted to roll back to Mike's tree as of a certain patch, http://www.winehq.org/pipermail/wine-patches/2006-April/026126.html
I gather the right command for this is "git reset", so I read the man page. It wants a "commit-ish" as the argument. (Boy, that's helpful.) Looking at that patch, I saw its filename was an md5 sum, so I figured maybe that was the "commit-ish", and tried
$ git reset --soft b32ae7a40c601427fea7cb9f145138221030f869 fatal: Needed a single revision
Crud. At this point I punted, sent an email to James asking for help, ate a cookie, and periodically re-read google and the man pages. Eventually it dawned on me that you can specify a particular commit by how many back from the head it is, e.g. HEAD~5 is 5 back from the tip. I also stumbled on the command "git log", which shows you all changes, most recent first. Sure enough, the change I wanted was eight back from the head. So I tried
$ git reset --soft HEAD~8
And voila, it worked; "git log" now showed the desired change as the latest! (Whew. I thought I was going to drown in man pages for a while there.)
Annoyingly, "make" did nothing after this, but I knew the changes I wanted to revert were all in one DLL, so I just removed that DLL's .o files and ran make again.
I feel a bit more comfortable with git now! - Dan
Dan Kegel wrote:
I gather the right command for this is "git reset", so I read the man page. It wants a "commit-ish" as the argument. (Boy, that's helpful.) Looking at that patch, I saw its filename was an md5 sum, so I figured maybe that was the "commit-ish", and tried
$ git reset --soft b32ae7a40c601427fea7cb9f145138221030f869 fatal: Needed a single revision
You can get a "commit-ish" SHA-1 IDs for your tree using "git whatchanged".
A commit is an SHA1 ID of the commit it was based off, the patch committer's name+email, the patch author's name+email, the time of the commit and the root directory of the tree committed.
Since James's tree had him as the committer, and my tree has me as the committer, the SHA1 IDs won't be the same. If I were to pull/merge his tree, then they would be.
$ git reset --soft HEAD~8
And voila, it worked; "git log" now showed the desired change as the latest! (Whew. I thought I was going to drown in man pages for a while there.)
Annoyingly, "make" did nothing after this, but I knew the changes I wanted to revert were all in one DLL, so I just removed that DLL's .o files and ran make again.
"git reset" as used above will only modify the commit history. "git diff" should now show you the diff between the old HEAD and the old HEAD~8.
You can use "git reset --hard" to change the checked out tree too, but it will reset it to the point you specify, and you will lose any changes not committed at that point.
So, to reset your whole tree (commit log and checked out files) to the state it was just after the previous commit, you do:
git reset --hard HEAD^
I feel a bit more comfortable with git now!
Great! It's a bit of a hard slog at first, but as more people get used to GIT, then it should be easier to get help.
You've probably see this already, but incase others haven't the Wine Wiki has a page on GIT here:
http://wiki.winehq.org/GitWine
Mike
Dan Kegel wrote:
This is a little success story. I thought I'd post it to encourage other people to try Mike's tree via git.
I just started using git so I could track Mike McCormack's tree. I first followed the instructions at http://wiki.winehq.org/GitWine to get a winehq tree, then followed Mike's instructions at http://www.winehq.org/pipermail/wine-devel/2006-April/047208.html to grab the latest changes.
The commands I used on my Ubuntu box were, all in all:
sudo apt-get install git-core git-doc git clone git://source.winehq.org/git/wine.git wine-git cat > .git/remotes/mmbranch <<EOF URL: http://mandoo.dyndns.org/wine.git Pull: refs/heads/master:refs/heads/mmbranch EOF git fetch mmbranch git pull . mmbranch
Everything went smoothly; it was rather fabulous. Then I ran into a regression, and wanted to roll back to Mike's tree as of a certain patch, http://www.winehq.org/pipermail/wine-patches/2006-April/026126.html
I gather the right command for this is "git reset", so I read the man page. It wants a "commit-ish" as the argument. (Boy, that's helpful.) Looking at that patch, I saw its filename was an md5 sum, so I figured maybe that was the "commit-ish", and tried
$ git reset --soft b32ae7a40c601427fea7cb9f145138221030f869 fatal: Needed a single revision
Crud. At this point I punted, sent an email to James asking for help, ate a cookie, and periodically re-read google and the man pages. Eventually it dawned on me that you can specify a particular commit by how many back from the head it is, e.g. HEAD~5 is 5 back from the tip. I also stumbled on the command "git log", which shows you all changes, most recent first. Sure enough, the change I wanted was eight back from the head. So I tried
$ git reset --soft HEAD~8
And voila, it worked; "git log" now showed the desired change as the latest! (Whew. I thought I was going to drown in man pages for a while there.)
Annoyingly, "make" did nothing after this, but I knew the changes I wanted to revert were all in one DLL, so I just removed that DLL's .o files and ran make again.
I feel a bit more comfortable with git now!
- Dan
Thanks Dan,
That's just what I needed!
Phil Costin