From: Phillip Wood Date: Thu, 19 Jul 2018 09:20:53 GMT Subject: Re: [PATCH] sequencer.c: terminate the last line of author-script properly Message-ID: <9ecdf160-bc8b-b91d-a70e-ca6fb9d2a756@talktalk.net> In-Reply-To: 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 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