From: Junio C Hamano Date: Mon, 18 Mar 2019 06:35:56 GMT Subject: Re: [PATCH v8 00/11] Fix scissors bug during conflict Message-ID: In-Reply-To: <20190317130539.GA23160@szeder.dev> SZEDER Gábor writes: >> + git commit ${3+"$3"} -m "$2" >act && >> + head -1 tmp && >> + mv tmp act && > > Here you could swap the order of when you write to 'act' and 'tmp', > and thus make the 'mv' unnecessary, like this: > > git commit [...] >tmp && > head -1 act >tmp && > [...rest of the test...] > > Note also that 'head' (or 'sed' in later tests) can open its input > file on its own, there's no need to redirect its standard input. Yup, that is better with a slight fix git testing-output-from-this-command ... >tmp && head -n 1 tmp >actual && to actually read from the output kept in the temporary file. Especially I think bare - is a BSDism that has been removed from POSIX some time ago.