From: Junio C Hamano Date: Tue, 02 Jun 2015 18:22:19 GMT Subject: Re: [PATCH/RFCv3 2/2] git rebase -i: warn about removed commits Message-ID: In-Reply-To: <133653833.39653.1433262736640.JavaMail.zimbra@ensimag.grenoble-inp.fr> Remi Galan Alfonso writes: > In this case it is not true, because of the infile and outfile being > identical. However sort does have a -o (-output) that I missed that > allows avoiding using echo or writing in another file; I'm correcting > with this. Even though it is in POSIX, some implementation may lack it, so our code tend to avoid "sort -o". "echo $(sort)" is also ugly and inefficient. The obvious and old-fashioned would be sufficient here: sort -u "$todo".oldsha1 >"$todo".oldsha1+ && mv "$todo".oldsha1+ "$todo".oldsha1