{"thread":{"id":"7175","subject":"[PATCH 1/8] Switch to run_command_v_opt in revert","startedAt":"2007-03-10T08:27:28Z","lastAt":"2007-03-11T01:46:40Z","messageCount":3,"participants":["Shawn O. Pearce","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"36733","messageId":"20070310082728.GA4133@spearce.org","threadId":"7175","inReplyTo":null,"subject":"[PATCH 1/8] Switch to run_command_v_opt in revert","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-03-10T08:27:28Z","receivedAt":"2007-03-10T08:27:28Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Another change by me is removing the va_list variants of run_command,\none of which is used by builtin-revert.c.  To avoid compile errors\nI'm refactoring builtin-revert to use the char** variant instead,\nas that variant is staying.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n This is on top of Dscho's builtin revert topic, currently in next.\n The rest of this series is however on top of master.\n\n builtin-revert.c |   13 +++++++++----\n 1 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-revert.c b/builtin-revert.c\nindex 2f2dc1b..652eece 100644\n--- a/builtin-revert.c\n+++ b/builtin-revert.c\n@@ -207,6 +207,7 @@ static int merge_recursive(const char *base_sha1,\n \t\tconst char *next_sha1, const char *next_name)\n {\n \tchar buffer[256];\n+\tconst char *argv[6];\n \n \tsprintf(buffer, \"GITHEAD_%s\", head_sha1);\n \tsetenv(buffer, head_name, 1);\n@@ -219,10 +220,14 @@ static int merge_recursive(const char *base_sha1,\n \t * and $prev on top of us (when reverting), or the change between\n \t * $prev and $commit on top of us (when cherry-picking or replaying).\n \t */\n-\n-\treturn run_command_opt(RUN_COMMAND_NO_STDIN | RUN_GIT_CMD,\n-\t\t\t\"merge-recursive\", base_sha1, \"--\",\n-\t\t\thead_sha1, next_sha1, NULL);\n+\targv[0] = \"merge-recursive\";\n+\targv[1] = base_sha1;\n+\targv[2] = \"--\";\n+\targv[3] = head_sha1;\n+\targv[4] = next_sha1;\n+\targv[5] = NULL;\n+\n+\treturn run_command_v_opt(argv, RUN_COMMAND_NO_STDIN | RUN_GIT_CMD);\n }\n \n static int revert_or_cherry_pick(int argc, const char **argv)\n-- \n1.5.0.3.942.g299f\n"},{"id":"36749","messageId":"Pine.LNX.4.63.0703101755090.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7175","inReplyTo":"20070310082728.GA4133@spearce.org","subject":"Re: [PATCH 1/8] Switch to run_command_v_opt in revert","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-10T16:55:44Z","receivedAt":"2007-03-10T16:55:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 10 Mar 2007, Shawn O. Pearce wrote:\n\n> Another change by me is removing the va_list variants of run_command,\n> one of which is used by builtin-revert.c.  To avoid compile errors\n> I'm refactoring builtin-revert to use the char** variant instead,\n> as that variant is staying.\n> \n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n> ---\n> \n>  This is on top of Dscho's builtin revert topic, currently in next.\n>  The rest of this series is however on top of master.\n\nACK.\n\nI did not realize that -revert and -cherry-pick would be the only users...\n\nCiao,\nDscho\n"},{"id":"36772","messageId":"20070311014640.GB10343@spearce.org","threadId":"7175","inReplyTo":"Pine.LNX.4.63.0703101755090.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 1/8] Switch to run_command_v_opt in revert","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-03-11T01:46:40Z","receivedAt":"2007-03-11T01:46:40Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> On Sat, 10 Mar 2007, Shawn O. Pearce wrote:\n> > Another change by me is removing the va_list variants of run_command,\n> > one of which is used by builtin-revert.c.  To avoid compile errors\n> > I'm refactoring builtin-revert to use the char** variant instead,\n> > as that variant is staying.\n> \n> I did not realize that -revert and -cherry-pick would be the only users...\n\nI didn't realize how little those functions were used either until\nI started poking around in there.  I'm actually shocked that your\nbuiltin-revert rewrite was the only one using it.  ;-)\n\n-- \nShawn.\n"}]}