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

[PATCH v2 2/8] revert: use run_command_v_opt() instead of execv_git_cmd()

From
Christian Couder <chriscool@tuxfamily.org>
Date
Jun 2, 2010, 05:58 UTC
Message-ID
<20100602055842.21504.65497.chriscool@tuxfamily.org>
In-Reply-To
<20100602055131.21504.71923.chriscool@tuxfamily.org>

This is needed by the following commits, because we are going to cherry pick many commits instead of just one.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 builtin/revert.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 5df0d69..02f18c2 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -508,6 +508,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 		}
 	}
 
+	free_message(&msg);
+
 	/*
 	 *
 	 * If we are cherry-pick, and if the merge did not result in
@@ -520,7 +522,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 	if (!no_commit) {
 		/* 6 is max possible length of our args array including NULL */
 		const char *args[6];
+		int res;
 		int i = 0;
+
 		args[i++] = "commit";
 		args[i++] = "-n";
 		if (signoff)
@@ -530,9 +534,12 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 			args[i++] = defmsg;
 		}
 		args[i] = NULL;
-		return execv_git_cmd(args);
+		res = run_command_v_opt(args, RUN_GIT_CMD);
+		free(defmsg);
+
+		return res;
 	}
-	free_message(&msg);
+
 	free(defmsg);
 
 	return 0;
-- 
1.7.1.362.g8d752
Previous: Christian CouderNext: Christian Couder
Message 3 of 9 in “implement cherry-picking many commits”
  1. 0/8 implement cherry-picking many commitsChristian Couder, Jun 2, 2010
  2. 1/8 revert: cleanup code for -x optionChristian Couder, Jun 2, 2010
  3. 2/8 revert: use run_command_v_opt() instead of execv_git_cmd()Christian Couder, Jun 2, 2010
  4. 3/8 revert: refactor code into a do_pick_commit() functionChristian Couder, Jun 2, 2010
  5. 4/8 revert: change help_msg() to take no argumentChristian Couder, Jun 2, 2010
  6. 5/8 revert: allow cherry-picking more than one commitChristian Couder, Jun 2, 2010
  7. 6/8 revert: add tests to check cherry-picking many commitsChristian Couder, Jun 2, 2010
  8. 7/8 Documentation/cherry-pick: describe passing more than one commitChristian Couder, Jun 2, 2010
  9. 8/8 Documentation/revert: describe passing more than one commitChristian Couder, Jun 2, 2010

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.