{"thread":{"id":"15867","subject":"[PATCH] Documentation: remove stale howto/rebase-and-edit.txt","startedAt":"2008-10-12T11:21:48Z","lastAt":"2008-10-12T11:21:48Z","messageCount":1,"participants":["Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92831","messageId":"1223810508-23615-1-git-send-email-trast@student.ethz.ch","threadId":"15867","inReplyTo":null,"subject":"[PATCH] Documentation: remove stale howto/rebase-and-edit.txt","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-10-12T11:21:48Z","receivedAt":"2008-10-12T11:21:48Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"The \"rebase and edit\" howto predates the much easier solution 'git\nrebase -i' by two years.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n Documentation/howto/rebase-and-edit.txt |   79 -------------------------------\n 1 files changed, 0 insertions(+), 79 deletions(-)\n\ndiff --git a/Documentation/howto/rebase-and-edit.txt b/Documentation/howto/rebase-and-edit.txt\ndeleted file mode 100644\nindex 554909f..0000000\n--- a/Documentation/howto/rebase-and-edit.txt\n+++ /dev/null\n@@ -1,79 +0,0 @@\n-Date:\tSat, 13 Aug 2005 22:16:02 -0700 (PDT)\n-From:\tLinus Torvalds <torvalds@osdl.org>\n-To:\tSteve French <smfrench@austin.rr.com>\n-cc:\tgit@vger.kernel.org\n-Subject: Re: sending changesets from the middle of a git tree\n-Abstract: In this article, Linus demonstrates how a broken commit\n- in a sequence of commits can be removed by rewinding the head and\n- reapplying selected changes.\n-\n-On Sat, 13 Aug 2005, Linus Torvalds wrote:\n-\n-> That's correct. Same things apply: you can move a patch over, and create a\n-> new one with a modified comment, but basically the _old_ commit will be\n-> immutable.\n-\n-Let me clarify.\n-\n-You can entirely _drop_ old branches, so commits may be immutable, but\n-nothing forces you to keep them. Of course, when you drop a commit, you'll\n-always end up dropping all the commits that depended on it, and if you\n-actually got somebody else to pull that commit you can't drop it from\n-_their_ repository, but undoing things is not impossible.\n-\n-For example, let's say that you've made a mess of things: you've committed\n-three commits \"old->a->b->c\", and you notice that \"a\" was broken, but you\n-want to save \"b\" and \"c\". What you can do is\n-\n-\t# Create a branch \"broken\" that is the current code\n-\t# for reference\n-\tgit branch broken\n-\n-\t# Reset the main branch to three parents back: this\n-\t# effectively undoes the three top commits\n-\tgit reset HEAD^^^\n-\tgit checkout -f\n-\n-\t# Check the result visually to make sure you know what's\n-\t# going on\n-\tgitk --all\n-\n-\t# Re-apply the two top ones from \"broken\"\n-\t#\n-\t# First \"parent of broken\" (aka b):\n-\tgit-diff-tree -p broken^ | git-apply --index\n-\tgit commit --reedit=broken^\n-\n-\t# Then \"top of broken\" (aka c):\n-\tgit-diff-tree -p broken | git-apply --index\n-\tgit commit --reedit=broken\n-\n-and you've now re-applied (and possibly edited the comments) the two\n-commits b/c, and commit \"a\" is basically gone (it still exists in the\n-\"broken\" branch, of course).\n-\n-Finally, check out the end result again:\n-\n-\t# Look at the new commit history\n-\tgitk --all\n-\n-to see that everything looks sensible.\n-\n-And then, you can just remove the broken branch if you decide you really\n-don't want it:\n-\n-\t# remove 'broken' branch\n-\tgit branch -d broken\n-\n-\t# Prune old objects if you're really really sure\n-\tgit prune\n-\n-And yeah, I'm sure there are other ways of doing this. And as usual, the\n-above is totally untested, and I just wrote it down in this email, so if\n-I've done something wrong, you'll have to figure it out on your own ;)\n-\n-\t\t\tLinus\n--\n-To unsubscribe from this list: send the line \"unsubscribe git\" in\n-the body of a message to majordomo@vger.kernel.org\n-More majordomo info at  http://vger.kernel.org/majordomo-info.html\n-- \ntg: (e782e12..) t/doc-remove-old-howto (depends on: spearce/master)\n"}]}