git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git apply won't work

From
MPMartin Paraskevov <martin.paraskevov@gmail.com>
Date
Mar 12, 2009, 23:14 UTC
Message-ID
<a6d7dc140903121614s229ce97an2cb5737ef46c0421@mail.gmail.com>
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
Next: Bryan Donlan
Message 1 of 2 in “git apply won't work”
  1. Martin ParaskevovMar 12, 2009
  2. Bryan DonlanMar 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.