Linus Torvalds <torvalds@linux-foundation.org> writes:Yeah, I noticed the first one but not the second. Thanks. By the way,... People occasionally ask "how would I make a small fix to a commit that is buried in the history", so let me take a moment to give them a recipe. Let's say while reviewing the code after applying all of the 6-series, you noticed the above thinko. First find out which commit caused it: $ git checkout lt/gitlink $ git blame -L229,+7 master.. -- refs.c b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 229) if (!f) b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 230) re.. b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 231) read_packe.. b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 232) ref = refs.. b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 233) retval = -.. b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 234) while (ref.. b60108a1 (Linus Torvalds 2007-04-09 21:14:26 -0700 235) if.. The commit to fix is b60108a1 (this is what I have in my private repo, and I'll be rebuilding the series with this example, so you will never see this commit object name in the end result I'll be pushing out). So I detach the HEAD at that commit and make a fix: $ git checkout b60108a1 $ edit refs.c $ git diff; # just to make sure $ git commit -a --amend At this point, the detached HEAD and the original branch look like this: $ git show-branch lt/gitlink HEAD ! [lt/gitlink] Teach core object handling functions about gitlinks * [HEAD] Add 'resolve_gitlink_ref()' helper function -- * [HEAD] Add 'resolve_gitlink_ref()' helper function + [lt/gitlink] Teach core object handling functions about gitlinks + [lt/gitlink^] Teach "fsck" not to follow subproject links + [lt/gitlink~2] Add "S_IFDIRLNK" file mode infrastructure for git links + [lt/gitlink~3] Add 'resolve_gitlink_ref()' helper function +* [HEAD^] Avoid overflowing name buffer in deep directory structures We fixed lt/gitlink~3 and the fixed-up commit is at HEAD. We want to rebase the rest of lt/gitlink on top of HEAD, like this: $ git rebase HEAD lt/gitlink This will take us back on lt/gitlink branch, set the tip of the branch to the commit we just made with the fix-up, and the first round will try to apply the change lt/gitlink~3 brings in on top of our HEAD. This _will_ fail, but that is to be expected, as we intend to replace that with what we just amended. Just reset it away and keep going. $ git reset --hard $ git rebase --skip Dealing with the other one in read-cache.c can be handled similarly after this. Luckily blame finds out that it is the last in the series (i.e. at the tip of lt/gitlink branch), so usual "fix the topmost commit" procedure applies. $ edit read-cache.c $ git diff ;# checking... $ git commit -a --amend - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| debian developer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 014/196] kobject: remove incorrect comment in kobject_rename |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Stephen Rothwell | Re: Announce: Linux-next (Or Andrew's dream :-)) |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Radu Rendec | htb parallelism on multi-core platforms |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
