Re: [PATCH/RFCv3 2/2] git rebase -i: warn about removed commits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 2, 2015, 18:22 UTC
- Message-ID
- <xmqqoaky2co4.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <133653833.39653.1433262736640.JavaMail.zimbra@ensimag.grenoble-inp.fr>
Remi Galan Alfonso <remi.galan-alfonso@ensimag.grenoble-inp.fr> 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