Re: [PATCH v2 2/2] git-add: introduce --edit (to edit the diff vs. the index)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Pieter de Bie
Date: Thursday, June 5, 2008 - 11:12 am

On 5 jun 2008, at 18:20, Johannes Schindelin wrote:


Nice feature! However, the lockfile isn't deleted on my system (OS X),
perhaps because the atexit() isn't called after an exec(). How about  
this
patch?

diff --git a/builtin-add.c b/builtin-add.c
index 05ae40d..07fdd2e 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -192,6 +192,8 @@ int edit_patch(int argc, const char **argv, const  
char *prefix)
         struct child_process child;
         int ac;
         struct stat st;
+       const char * apply_args[] = { "apply", "--fixup-line-counts",
+                                     "--cached", lock.filename, NULL };

         memset(&child, 0, sizeof(child));
         child.argv = xcalloc(sizeof(const char *), (argc + 5));
@@ -224,10 +226,11 @@ int edit_patch(int argc, const char **argv,  
const char *prefix)
                 return 0;
         }

-       execl_git_cmd("apply", "--fixup-line-counts", "--cached",
-                       lock.filename, NULL);
+       child.argv = apply_args;
+       if (run_command(&child))
+               return 1;

-       return 1;
+       return 0;
  }

  static struct lock_file lock_file;


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] Allow git-apply to fix up the line counts, Johannes Schindelin, (Thu Jun 5, 3:16 am)
[PATCH 2/2] git-add: introduce --edit (to edit the diff vs ..., Johannes Schindelin, (Thu Jun 5, 3:17 am)
Re: [PATCH 1/2] Allow git-apply to fix up the line counts, Johannes Schindelin, (Thu Jun 5, 6:04 am)
Re: [PATCH 1/2] Allow git-apply to fix up the line counts, Johannes Schindelin, (Thu Jun 5, 6:47 am)
Re: [PATCH 1/2] Allow git-apply to fix up the line counts, Johannes Schindelin, (Thu Jun 5, 7:54 am)
[PATCH v2 0/2] git add --edit, Johannes Schindelin, (Thu Jun 5, 9:19 am)
[PATCH v2 1/2] Allow git-apply to ignore the hunk headers, Johannes Schindelin, (Thu Jun 5, 9:20 am)
[PATCH v2 2/2] git-add: introduce --edit (to edit the diff ..., Johannes Schindelin, (Thu Jun 5, 9:20 am)
Re: [PATCH v2 2/2] git-add: introduce --edit (to edit the ..., Pieter de Bie, (Thu Jun 5, 11:12 am)
Re: [PATCH 1/2] Allow git-apply to fix up the line counts, Junio C Hamano, (Thu Jun 5, 11:39 am)
Re: [PATCH v2 1/2] Allow git-apply to ignore the hunk headers, Johannes Schindelin, (Thu Jun 5, 3:39 pm)
[PATCH v3 0/2] git add --edit, Johannes Schindelin, (Thu Jun 5, 4:06 pm)
[PATCH v3 1/2] Allow git-apply to ignore the hunk headers ..., Johannes Schindelin, (Thu Jun 5, 4:06 pm)
[PATCH v3 2/2] git-add: introduce --edit (to edit the diff ..., Johannes Schindelin, (Thu Jun 5, 4:07 pm)
Re: [PATCH v2 1/2] Allow git-apply to ignore the hunk headers, Johannes Schindelin, (Thu Jun 5, 4:36 pm)
Re: [PATCH v3 0/2] git add --edit, Junio C Hamano, (Thu Jun 5, 9:55 pm)
Re: [PATCH v3 1/2] Allow git-apply to ignore the hunk head ..., Johannes Schindelin, (Fri Jun 6, 6:58 am)
Re: [PATCH v3 0/2] git add --edit, Johannes Schindelin, (Fri Jun 6, 6:59 am)
Re: [PATCH v3 1/2] Allow git-apply to ignore the hunk head ..., Johannes Schindelin, (Fri Jun 6, 7:00 am)
Re: [PATCH v2 1/2] Allow git-apply to ignore the hunk headers, Johannes Schindelin, (Fri Jun 6, 7:04 am)
Re: [PATCH v3 2/2] git-add: introduce --edit (to edit the ..., Johannes Schindelin, (Fri Jun 6, 7:21 am)
Re: [PATCH v2 1/2] Allow git-apply to ignore the hunk headers, Johannes Schindelin, (Fri Jun 6, 7:27 am)
Re: [PATCH v3 1/2] Allow git-apply to ignore the hunk head ..., Johannes Schindelin, (Fri Jun 6, 9:37 am)
Re: [PATCH v3 1/2] Allow git-apply to ignore the hunk head ..., Johannes Schindelin, (Fri Jun 6, 10:35 am)