Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-27 Thread Johannes Schindelin
Hi Junio, On Thu, 26 Jul 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Hi Junio, > > > > On Tue, 17 Jul 2018, Junio C Hamano wrote: > > > >> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh > >> index 2d189da2f1..b0cef509ab 100755 > >> ---

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-26 Thread Junio C Hamano
Johannes Schindelin writes: >> You're right, I'm not sure how I missed the calls to sq_quote_buf() >> yesterday, sharing the am code with the sequencer would clean things up >> nicely. > > No, actually Phillip was right. The `author-script` file written by > `git-am` was always an implementation

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-26 Thread Junio C Hamano
Johannes Schindelin writes: > Hi Junio, > > On Tue, 17 Jul 2018, Junio C Hamano wrote: > >> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh >> index 2d189da2f1..b0cef509ab 100755 >> --- a/t/t3404-rebase-interactive.sh >> +++ b/t/t3404-rebase-interactive.sh >> @@ -81,11

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-26 Thread Johannes Schindelin
Hi Phillip, On Thu, 19 Jul 2018, Phillip Wood wrote: > On 18/07/18 18:17, Junio C Hamano wrote: > > Phillip Wood writes: > > > >>> (I think we had code to do so in "git am" > >>> that was rewritten in C first). > >> > >> The code in builtin/am.c doesn't try to write valid posix shell (if > >>

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-26 Thread Johannes Schindelin
Hi Junio, On Tue, 17 Jul 2018, Junio C Hamano wrote: > diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh > index 2d189da2f1..b0cef509ab 100755 > --- a/t/t3404-rebase-interactive.sh > +++ b/t/t3404-rebase-interactive.sh > @@ -81,11 +81,13 @@ test_expect_success 'rebase -i

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-19 Thread Phillip Wood
Hi Junio On 18/07/18 18:17, Junio C Hamano wrote: > Phillip Wood writes: > >>> (I think we had code to do so in "git am" >>> that was rewritten in C first). >> >> The code in builtin/am.c doesn't try to write valid posix shell (if >> one assumes it is the only consumer of the author script then

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-18 Thread Junio C Hamano
Phillip Wood writes: >> (I think we had code to do so in "git am" >> that was rewritten in C first). > > The code in builtin/am.c doesn't try to write valid posix shell (if > one assumes it is the only consumer of the author script then it > doesn't need to) which results in simpler code, but

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-18 Thread Phillip Wood
Hi Akinori On 12/07/18 12:18, Akinori MUSHA wrote: It looks like write_author_script() intends to write out a file in Bourne shell syntax, but it doesn't put a closing single quote on the last line. This patch makes .git/rebase-merge/author-script actually parsable by sh(1) by adding a single

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-18 Thread Phillip Wood
Hi Junio On 12/07/18 18:22, Junio C Hamano wrote: "Akinori MUSHA" writes: It looks like write_author_script() intends to write out a file in Bourne shell syntax, but it doesn't put a closing single quote on the last line. s/closing single quote/& and the terminating newline/? This

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-18 Thread Phillip Wood
Hi Akinori On 12/07/18 12:18, Akinori MUSHA wrote: It looks like write_author_script() intends to write out a file in Bourne shell syntax, but it doesn't put a closing single quote on the last line. This patch makes .git/rebase-merge/author-script actually parsable by sh(1) by adding a single

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-18 Thread Akinori MUSHA
That's perfectly fine with me. I just thought each test case would run in a separate shell process and that's why I chose not to use a subshell for the last lines. I've learned a lot from feedback from you all. Thanks! On Wed, 18 Jul 2018 08:25:22 +0900, Junio C Hamano wrote: > > I'll squash

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-17 Thread Junio C Hamano
I'll squash the following in (which I have been carrying in 'pu' for the past few days) unless I hear otherwise soonish to correct the issues raised during the review. Thanks. t/t3404-rebase-interactive.sh | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-12 Thread Junio C Hamano
Junio C Hamano writes: > I _think_ the right and safe way to fix taht is to do something like > this: > > test -f .git/rebase-merge/author-script && > ( > safe_unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL ... && > eval "$(cat .git/rebase-merge/author-script)" &&

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-12 Thread Junio C Hamano
Yup ;-) On Thu, Jul 12, 2018 at 1:16 PM, Eric Sunshine wrote: > On Thu, Jul 12, 2018 at 4:13 PM Junio C Hamano wrote: >> I _think_ the right and safe way to fix taht is to do something like >> this: >> >> test -f .git/rebase-merge/author-script && >> ( >>

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-12 Thread Eric Sunshine
On Thu, Jul 12, 2018 at 4:13 PM Junio C Hamano wrote: > I _think_ the right and safe way to fix taht is to do something like > this: > > test -f .git/rebase-merge/author-script && > ( > safe_unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL ... && s/safe_unset/sane_unset/ >

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-12 Thread Junio C Hamano
"Akinori MUSHA" writes: > diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh > index 352a52e59..345b103eb 100755 > --- a/t/t3404-rebase-interactive.sh > +++ b/t/t3404-rebase-interactive.sh > @@ -75,6 +75,19 @@ test_expect_success 'rebase --keep-empty' ' >

Re: [PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-12 Thread Junio C Hamano
"Akinori MUSHA" writes: > It looks like write_author_script() intends to write out a file in > Bourne shell syntax, but it doesn't put a closing single quote on the > last line. s/closing single quote/& and the terminating newline/? > > This patch makes .git/rebase-merge/author-script actually

[PATCH] sequencer.c: terminate the last line of author-script properly

2018-07-12 Thread Akinori MUSHA
It looks like write_author_script() intends to write out a file in Bourne shell syntax, but it doesn't put a closing single quote on the last line. This patch makes .git/rebase-merge/author-script actually parsable by sh(1) by adding a single quote and a linefeed to terminate the line properly.