git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/3] t7504: document regression: reword no longer calls commit-msg
Date: Wed, 22 Mar 2017 17:09:38 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1703221704500.3767@virtualbox> (raw)
In-Reply-To: <CAHGBnuPL9CUincZkFR758KcZL3-Ra=n_fbsc1EQ=vio2scod5w@mail.gmail.com>

Hi Sebastian,

On Wed, 22 Mar 2017, Sebastian Schuberth wrote:

> On Wed, Mar 22, 2017 at 4:01 PM, Johannes Schindelin
> <johannes.schindelin@gmx.de> wrote:
> 
> > +# 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"

It's not portable, otherwise I would have used it. GNU sed expects an
optional extension to be used for a backup file, and that optional
extension needs to be specified without whitespace between it and the -i
option. BSD sed *requires* an extension to be specified, and it has to be
separated using white space (or is that orange space now?).

So even if we could make that call portable somehow (and remember, BSD sed
is what OSX uses), there *would be a backup file*.

> 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?

No. The file in question is written to the .git/rebase-merge/
subdirectory, therefore cleaned up after the rebase.

In any case, this is *test* code. So I'd prefer to have the changes to the
C code scrutinized a bit more, not the test code as long as it is obvious
what it does.

Ciao,
Johannes

  reply	other threads:[~2017-03-22 16:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 15:01 [PATCH 0/3] rebase -i (reword): call the commit-msg hook again Johannes Schindelin
2017-03-22 15:01 ` [PATCH 1/3] t7504: document regression: reword no longer calls commit-msg Johannes Schindelin
2017-03-22 15:18   ` Sebastian Schuberth
2017-03-22 16:09     ` Johannes Schindelin [this message]
2017-03-22 18:15       ` Junio C Hamano
2017-03-23 14:43         ` Johannes Schindelin
2017-03-23 14:55           ` Sebastian Schuberth
2017-03-23 15:52             ` Johannes Schindelin
2017-03-22 18:12     ` Junio C Hamano
2017-03-23 14:41       ` Johannes Schindelin
2017-03-22 15:01 ` [PATCH 2/3] sequencer: make commit options more extensible Johannes Schindelin
2017-03-22 18:21   ` Junio C Hamano
2017-03-23 14:39     ` Johannes Schindelin
2017-03-23 16:04   ` Junio C Hamano
2017-03-22 15:02 ` [PATCH 3/3] sequencer: allow the commit-msg hooks to run during a `reword` Johannes Schindelin
2017-03-22 18:43   ` Junio C Hamano
2017-03-23 15:49     ` Johannes Schindelin
2017-03-23 16:07 ` [PATCH v2 0/3] rebase -i (reword): call the commit-msg hook again Johannes Schindelin
2017-03-23 16:07   ` [PATCH v2 1/3] t7504: document regression: reword no longer calls commit-msg Johannes Schindelin
2017-03-23 16:07   ` [PATCH v2 2/3] sequencer: make commit options more extensible Johannes Schindelin
2017-03-24  1:01     ` Junio C Hamano
2017-03-25  0:01       ` Johannes Schindelin
2017-03-27  0:55         ` Junio C Hamano
2017-03-27 21:03           ` Junio C Hamano
2017-03-29 12:49             ` Johannes Schindelin
2017-03-23 16:07   ` [PATCH v2 3/3] sequencer: allow the commit-msg hooks to run during a `reword` Johannes Schindelin
2017-03-23 16:51     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1703221704500.3767@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sschuberth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).