All of lore.kernel.org
 help / color / mirror / Atom feed
* git apply won't work
@ 2009-03-12 23:14 Martin Paraskevov
  2009-03-13  0:09 ` Bryan Donlan
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Paraskevov @ 2009-03-12 23:14 UTC (permalink / raw)
  To: git

Hi all,

I did the following:

edited
did commit 1
edited
did commit 2
edited
did commit 3

Now I want to patch the changes between 2 and 3 onto 1, i.e. have commit 3 but
with the changes from commit 2 removed. I created a branch where I reset
it to commit 1 and then tried to apply the diff between 3 and 2.

The patch however won't patch certain files. It contains the excerpt below,
for example, so it should be patching directory.c but it isn't. The command
I'm running is just:

% git apply filesys.patch

What am I doing wrong?


diff --git a/src/filesys/directory.c b/src/filesys/directory.c
index 0d265d5..31b7fd6 100644
--- a/src/filesys/directory.c
+++ b/src/filesys/directory.c
@@ -2,50 +2,57 @@
 #include <stdio.h>
 #include <string.h>
 #include <list.h>
+#include "filesys/file.h"
 #include "filesys/filesys.h"
 #include "filesys/inode.h"
 #include "threads/malloc.h"
-
-/* A directory. */
-struct dir
-  {
-    struct inode *inode;                /* Backing store. */
-    off_t pos;                          /* Current position. */
-  };

... more lines ...


- Martin

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: git apply won't work
  2009-03-12 23:14 git apply won't work Martin Paraskevov
@ 2009-03-13  0:09 ` Bryan Donlan
  0 siblings, 0 replies; 2+ messages in thread
From: Bryan Donlan @ 2009-03-13  0:09 UTC (permalink / raw)
  To: Martin Paraskevov; +Cc: git

On Thu, Mar 12, 2009 at 7:14 PM, Martin Paraskevov
<martin.paraskevov@gmail.com> wrote:
> Hi all,
>
> I did the following:
>
> edited
> did commit 1
> edited
> did commit 2
> edited
> did commit 3
>
> Now I want to patch the changes between 2 and 3 onto 1, i.e. have commit 3 but
> with the changes from commit 2 removed. I created a branch where I reset
> it to commit 1 and then tried to apply the diff between 3 and 2.
>
> The patch however won't patch certain files. It contains the excerpt below,
> for example, so it should be patching directory.c but it isn't. The command
> I'm running is just:
>
> % git apply filesys.patch
>
> What am I doing wrong?


It's hard to say what's going wrong when we can't see the exact
errors, git tree and patch in question, but if you just want to remove
a patch, there are easier ways to do it.

If you want to keep the old patch in the history, but reverse it, do:
  git revert commitid
This will record a new commit that reverses the changes in the
indicated one. This is the recommended way to do things if others have
based work off your branch.

If you want to completely forget about the patch in question, you can
do this using git rebase --interactive:
  git rebase --interactive commitid~
  (an editor will open; remove the patch in question from the list,
save and exit your editor)
  (fix any conflicts that come up as prompted)
This will delete it from history, but will result in commit IDs for
commits after that point changing. If anyone has based work off your
branch, then you might have a hard time merging later.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-13  0:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 23:14 git apply won't work Martin Paraskevov
2009-03-13  0:09 ` Bryan Donlan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.