Re: [PATCH] sequencer.c: terminate the last line of author-script properly
- From
- Phillip Wood <phillip.wood@talktalk.net>
- Date
- Jul 19, 2018, 09:20 UTC
- Message-ID
- <9ecdf160-bc8b-b91d-a70e-ca6fb9d2a756@talktalk.net>
- In-Reply-To
- <xmqq7elslayl.fsf@gitster-ct.c.googlers.com>
Hi Junio
On 18/07/18 18:17, Junio C Hamano wrote:
Show 17 quoted lines
> Phillip Wood <phillip.wood@talktalk.net> 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 external scripts >> cannot safely eval it anymore. > > Are you sure about that? If so we probably should see if we can fix> the writer, and better yet, if we can share code with the writer > discussed here, as presumably we are fixing it in this thread. > > But I do not see how builtin/am.c::write_author_script() would > produce something that would not eval correctly. sq_quote_buf() was > introduced specifically to write correct string for shell's > consumption.
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.
Best Wishes
Phillip