{"thread":{"id":"18293","subject":"git apply won't work","startedAt":"2009-03-12T23:14:34Z","lastAt":"2009-03-13T00:09:44Z","messageCount":2,"participants":["Martin Paraskevov","Bryan Donlan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107886","messageId":"a6d7dc140903121614s229ce97an2cb5737ef46c0421@mail.gmail.com","threadId":"18293","inReplyTo":null,"subject":"git apply won't work","fromName":"Martin Paraskevov","fromEmail":"martin.paraskevov@gmail.com","sentAt":"2009-03-12T23:14:34Z","receivedAt":"2009-03-12T23:14:34Z","isPatch":false,"sender":{"key":"martin.paraskevov@gmail.com","avatar":null},"body":"Hi all,\n\nI did the following:\n\nedited\ndid commit 1\nedited\ndid commit 2\nedited\ndid commit 3\n\nNow I want to patch the changes between 2 and 3 onto 1, i.e. have commit 3 but\nwith the changes from commit 2 removed. I created a branch where I reset\nit to commit 1 and then tried to apply the diff between 3 and 2.\n\nThe patch however won't patch certain files. It contains the excerpt below,\nfor example, so it should be patching directory.c but it isn't. The command\nI'm running is just:\n\n% git apply filesys.patch\n\nWhat am I doing wrong?\n\n\ndiff --git a/src/filesys/directory.c b/src/filesys/directory.c\nindex 0d265d5..31b7fd6 100644\n--- a/src/filesys/directory.c\n+++ b/src/filesys/directory.c\n@@ -2,50 +2,57 @@\n #include <stdio.h>\n #include <string.h>\n #include <list.h>\n+#include \"filesys/file.h\"\n #include \"filesys/filesys.h\"\n #include \"filesys/inode.h\"\n #include \"threads/malloc.h\"\n-\n-/* A directory. */\n-struct dir\n-  {\n-    struct inode *inode;                /* Backing store. */\n-    off_t pos;                          /* Current position. */\n-  };\n\n... more lines ...\n\n\n- Martin\n"},{"id":"107887","messageId":"3e8340490903121709w6c6c444o10e7c8b655246373@mail.gmail.com","threadId":"18293","inReplyTo":"a6d7dc140903121614s229ce97an2cb5737ef46c0421@mail.gmail.com","subject":"Re: git apply won't work","fromName":"Bryan Donlan","fromEmail":"bdonlan@gmail.com","sentAt":"2009-03-13T00:09:44Z","receivedAt":"2009-03-13T00:09:44Z","isPatch":false,"sender":{"key":"bdonlan@gmail.com","avatar":null},"body":"On Thu, Mar 12, 2009 at 7:14 PM, Martin Paraskevov\n<martin.paraskevov@gmail.com> wrote:\n> Hi all,\n>\n> I did the following:\n>\n> edited\n> did commit 1\n> edited\n> did commit 2\n> edited\n> did commit 3\n>\n> Now I want to patch the changes between 2 and 3 onto 1, i.e. have commit 3 but\n> with the changes from commit 2 removed. I created a branch where I reset\n> it to commit 1 and then tried to apply the diff between 3 and 2.\n>\n> The patch however won't patch certain files. It contains the excerpt below,\n> for example, so it should be patching directory.c but it isn't. The command\n> I'm running is just:\n>\n> % git apply filesys.patch\n>\n> What am I doing wrong?\n\n\nIt's hard to say what's going wrong when we can't see the exact\nerrors, git tree and patch in question, but if you just want to remove\na patch, there are easier ways to do it.\n\nIf you want to keep the old patch in the history, but reverse it, do:\n  git revert commitid\nThis will record a new commit that reverses the changes in the\nindicated one. This is the recommended way to do things if others have\nbased work off your branch.\n\nIf you want to completely forget about the patch in question, you can\ndo this using git rebase --interactive:\n  git rebase --interactive commitid~\n  (an editor will open; remove the patch in question from the list,\nsave and exit your editor)\n  (fix any conflicts that come up as prompted)\nThis will delete it from history, but will result in commit IDs for\ncommits after that point changing. If anyone has based work off your\nbranch, then you might have a hard time merging later.\n"}]}