Hi all,
Hope this is the right place to post this, if not, my apologies.
Im trying to track down an issue that occurred between 0.9.19 and 0.9.20, and am using git bisect to track the issue. In the process of trying to identify the cause of the issue, I would like to be able to get the code up till a certain patch, and then apply patches one by one as well.
I have not been able to find out how to do this, despite several web searches and man pages. Can anyone give me any pointers to this please?
Thanks in advance
Kapila
What I do is to follow along with things on the shortlog: http://source.winehq.org/git/?p=wine.git;a=shortlog
Lets say you want to move your current branch to my recent patch "riched20: Rewrite of scrolling and some redrawing code." - you'd click the link "commit" to the right of it. In the page that you'll be taken to, you'll see a line like this: commit abecd9e393925e008449a80ec14682790b29042c
you can then do a "git reset --hard abecd9e393925e008449a80ec14682790b29042c"
and your git will be moved to the point in time right after that commit. If you then want to manually apply a patch, click "commitdiff" to the right of it's entry in the shortlog, followed by "plain" on the top - this will take you to a plaintext diff of the patch, which you could save to a file and apply with the patch command. ("patch -p1 < thepatch.diff" usualy works well for me)
--Matt
On 9/9/06, Kapila De Silva mail@kapila.force9.co.uk wrote:
Hi all,
Hope this is the right place to post this, if not, my apologies.
Im trying to track down an issue that occurred between 0.9.19 and 0.9.20, and am using git bisect to track the issue. In the process of trying to identify the cause of the issue, I would like to be able to get the code up till a certain patch, and then apply patches one by one as well.
I have not been able to find out how to do this, despite several web searches and man pages. Can anyone give me any pointers to this please?
Thanks in advance
Kapila
Matt Finnicum wrote:
What I do is to follow along with things on the shortlog: http://source.winehq.org/git/?p=wine.git;a=shortlog
Lets say you want to move your current branch to my recent patch "riched20: Rewrite of scrolling and some redrawing code." - you'd click the link "commit" to the right of it. In the page that you'll be taken to, you'll see a line like this: commit abecd9e393925e008449a80ec14682790b29042c
you can then do a "git reset --hard abecd9e393925e008449a80ec14682790b29042c"
and your git will be moved to the point in time right after that commit. If you then want to manually apply a patch, click "commitdiff" to the right of it's entry in the shortlog, followed by "plain" on the top - this will take you to a plaintext diff of the patch, which you could save to a file and apply with the patch command. ("patch -p1 < thepatch.diff" usualy works well for me)
There's easier ways to do the second bit.
1) Use git cherry-pick
git branch master-20060913 git reset --hard abecd9e393925e00 #examine the log for commits git log master-20060913..abecd9e39392 #pull in commits git cherry -r 112810a480aaee4d6d8 git cherry -r aaca30cf039c227e #etc
2) Use git format-patch to get all the patches in the tree before resetting:
# put them all in one file named mb git format-patch --stdout abecd9e39392 > mb
# or create multiple files git format-patch abecd9e393925e008
Then reset (remember to have a clean tree!)
git reset --hard abecd9e393925e
Then edit "mb" and "git am" the patches you want:
git am mb
You don't need the full SHA1 ID... just enough to make it unique in the tree.
Mike