Re: [PATCH 1/3] t7504: document regression: reword no longer calls commit-msg
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 23, 2017, 14:41 UTC
- Message-ID
- <alpine.DEB.2.20.1703231539410.3767@virtualbox>
- In-Reply-To
- <xmqqinn1kwo6.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Wed, 22 Mar 2017, Junio C Hamano wrote:
Show 26 quoted lines
> Sebastian Schuberth <sschuberth@gmail.com> writes: > > > On Wed, Mar 22, 2017 at 4:01 PM, Johannes Schindelin > > <johannes.schindelin@gmx.de> wrote: > > > >> Noticed by Sebastian Schuberth. > > > > Thanks for working on the fix. > > > >> +# set up fake editor to replace `pick` by `reword` > >> +cat > reword-editor <<'EOF' > >> +#!/bin/sh > >> +mv "$1" "$1".bup && > >> +sed 's/^pick/reword/' <"$1".bup >"$1" > >> +EOF > > > > Maybe use > > > > sed -i 's/^pick/reword/' "$1" > > > > here to avoid renaming the input file? Not sure how portable -i for > > sed is, though. Otherwise, maybe remove the file "$1".bup afterwards > > to be clean? > > "-i" is GNUism and it is a good idea to avoid it, but cleaning after > itself may be worth doing to avoid contaminating the working tree.
This script is only used as *sequence* editor, i.e. for .git/merge-rebase/git-rebase-todo. As such, I find it valuable to have the original version in the same directory, and the file is cleaned up upon success by the `git rebase -i` command anyway.
In that light, I am sure you agree that the current code is fine.
Ciao, Dscho