Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-18 Thread Paul Tan
On Tue, Jun 16, 2015 at 1:54 AM, Junio C Hamano wrote: > Paul Tan writes: > >>> The scripted Porcelain is spawned after applying patches 1-3 from >>> here, when you do not have _GIT_USE_BUILTIN_AM exported. Haven't >>> RUN_SETUP code did its thing by that time? >> >> Ah right, the RUN_SETUP code

Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-15 Thread Junio C Hamano
Paul Tan writes: >> The scripted Porcelain is spawned after applying patches 1-3 from >> here, when you do not have _GIT_USE_BUILTIN_AM exported. Haven't >> RUN_SETUP code did its thing by that time? > > Ah right, the RUN_SETUP code would have chdir()-ed to the working > directory root, so git-a

Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-15 Thread Paul Tan
On Tue, Jun 16, 2015 at 1:14 AM, Junio C Hamano wrote: > Paul Tan writes: > >> On Mon, Jun 15, 2015 at 6:08 AM, Junio C Hamano wrote: >>> Paul Tan writes: diff --git a/git.c b/git.c index 44374b1..42328ed 100644 --- a/git.c +++ b/git.c @@ -370,6 +370,7 @@ static int run

Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-15 Thread Junio C Hamano
Paul Tan writes: > On Mon, Jun 15, 2015 at 6:08 AM, Junio C Hamano wrote: >> Paul Tan writes: >>> diff --git a/git.c b/git.c >>> index 44374b1..42328ed 100644 >>> --- a/git.c >>> +++ b/git.c >>> @@ -370,6 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, >>> const char **argv) >

Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-15 Thread Paul Tan
On Mon, Jun 15, 2015 at 6:08 AM, Junio C Hamano wrote: > Paul Tan writes: >> diff --git a/git.c b/git.c >> index 44374b1..42328ed 100644 >> --- a/git.c >> +++ b/git.c >> @@ -370,6 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, >> const char **argv) >> >> static struct cmd_stru

Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-14 Thread Junio C Hamano
Paul Tan writes: > +int cmd_am(int argc, const char **argv, const char *prefix) > +{ > + if (!getenv("_GIT_USE_BUILTIN_AM")) { > + const char *path = mkpath("%s/git-am", git_exec_path()); > + > + if (sane_execvp(path, (char**) argv) < 0) Style: if (s

[PATCH/WIP v2 03/19] am: implement skeletal builtin am

2015-06-11 Thread Paul Tan
For the purpose of rewriting git-am.sh into a C builtin, implement a skeletal builtin/am.c that redirects to $GIT_EXEC_PATH/git-am if the environment variable _GIT_USE_BUILTIN_AM is not defined. Since in the Makefile git-am.sh takes precedence over builtin/am.c, $GIT_EXEC_PATH/git-am will contain t