#88 git new files

closed
nobody
None
5
2009-10-17
2008-11-03
Anonymous
No

I am having a problem importing a git patch into code striker, it doesn't seem to understand new files or something unusual about the patch file. Here is an example.....(in this example b.c was added and a.h was modified)

<snip>

diff --git a/comp1/a.h b/comp1/a.h
index 2aa4834..7acc9dd 100644
--- a/comp1/a.h
+++ b/comp1/a.h
@@ -2,6 +2,6 @@
#ifndef _A_H
#define _A_H

-int a;
+extern int a;

#endif /* _A_H */
diff --git a/comp2/b.c b/comp2/b.c
new file mode 100644
index 0000000..3922125
--- /dev/null
+++ b/comp2/b.c
@@ -0,0 +1,8 @@
+#include <a.h>
+
+int main (int argc, char *argv[])
+{
+ a = 5;
+ return 0;
+}
+

<snip>

When I import this into codestriker, it just assumes this is a regular file and I don't get the color code
diffs. To create the patch file, I just did

git diff 8a9a75606872b49f2d1a8ae276679bec0a616290 > tst.patch

git

Discussion

  • Nobody/Anonymous

    deleted files don't work either.

    A simple patch to PatchUnidiff.pm fixes the problem, though: prior to checking for "index" lines, also check for "new file" and "deleted file" and skip those lines.

     
  • David Sitsky

    David Sitsky - 2009-07-17

    How about showing your patch here?

     
  • David Sitsky

    David Sitsky - 2009-10-17

    We got git support from another author, so closing this off.

     
  • David Sitsky

    David Sitsky - 2009-10-17
    • status: open --> closed
     

Log in to post a comment.