Is there a way in git to apply the _DIFF_ of a commit as a patch?

In my specific case, I'm trying to progress a bugfix up a tree. It's a minor 
typo, but there were a LOT of commits made afterwards.

It's a bugfix that needs to be applied to stuff, but somewhere along the way, 
another serious bug got introduced.

Here's the minor fix:

keybounceMBP:realisticfluids michael$ git diff stash^ stash | cat
diff --git a/src/main/java/com/mcfht/realisticfluids/FluidData.java 
b/src/main/java/com/mcfht/realisticfluids/FluidData.java
index 514e857..a6c4ada 100644
--- a/src/main/java/com/mcfht/realisticfluids/FluidData.java
+++ b/src/main/java/com/mcfht/realisticfluids/FluidData.java
@@ -193,7 +193,9 @@ public class FluidData
          */
         public int getFluid(final int cx, final int cy, final int cz)
         {
-            return fluidArray[cy >> 4][cx + (cz << 4) + ((cy & 0xF) << 8)];
+            if ((c.getBlock(cx, cy, cz) instanceof BlockFiniteFluid))
+                return this.fluidArray[cy >> 4][cx + (cz << 4) + ((cy & 0xF) 
<< 8)];
+            return 0
         }
 
         /*
diff --git a/src/main/java/com/mcfht/realisticfluids/RealisticFluids.java 
b/src/main/java/com/mcfht/realisticfluids/RealisticFluids.java
index aa7cf2b..0612e53 100644
--- a/src/main/java/com/mcfht/realisticfluids/RealisticFluids.java
+++ b/src/main/java/com/mcfht/realisticfluids/RealisticFluids.java
@@ -333,7 +333,7 @@ public class RealisticFluids extends DummyModContainer
                        return;
                if (null == b)
                        return;
-               throw new RuntimeException("Wrong fluid type!");
+               // throw new RuntimeException("Wrong fluid type!");
        }
 
        public static void setBlockMetadata(final World world, final int x, 
final int y, final int z, final int meta, final int flag)

The problem? "git stash apply" wants, not to apply the patch/diff, but to 
replace the file -- and there's a lot of changes to that file along the way.

Is there a simple way to automate checking out various versions and applying 
the patch? Right now, my best approach is git checkout -m and hand-fixing-up 
(and I've already gotten that wrong once).

---
Entertaining minecraft videos
http://YouTube.com/keybounce

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to