From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stephen Haberman <stephen@exigencecorp.com>,
Thomas Rast <trast@student.ethz.ch>,
git@vger.kernel.org
Subject: Re: [PATCH 1/6] t3404 & t3411: undo copy&paste
Date: Tue, 27 Jan 2009 22:57:33 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.1.00.0901272254450.14855@racer> (raw)
In-Reply-To: <7v7i4g31lj.fsf@gitster.siamese.dyndns.org>
Hi,
On Tue, 27 Jan 2009, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Rather than copying and pasting, which is prone to lead to fixes
> > missing in one version, move the fake-editor generator to t/t3404/.
> >
> > While at it, fix a typo that causes head-scratching: use
> > ${SHELL_PATH-/bin/sh} instead of $SHELL_PATH.
>
> I've learned to be cautious whenever I see "while at it".
Heh.
> > diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh
> > new file mode 100644
> > index 0000000..8c8caab
> > --- /dev/null
> > +++ b/t/lib-rebase.sh
> > @@ -0,0 +1,36 @@
> > +#!/bin/sh
> > +
> > +set_fake_editor () {
> > + echo "#!${SHELL_PATH-/bin_sh}" >fake-editor.sh
>
> It is unclear why you would want to do this. It was unclear what "typo"
> you were referring to in your commit log message, either.
>
> The tests are supposed to run under the shell the user specified, so if
> there is a case you found that $SHELL_PATH is unset, that is a bug we
> would want to fix, and ${SHELL_PATH-/bin/sh} is sweeping the problem under
> the rug to make it harder to fix, isn't it?
I call the scripts directly, and I do not think it would be a good idea to
force the user to use GIT_TEST_OPTS and make when calling the script
directly is so much easier. Plus, this way I can pass "sh -x $SCRIPT"
easily.
I am really puzzled that it works, BTW. With an empty SHELL_PATH,
apparently.
> Besides, it's /bin/sh, not /bin_sh ;-)
Right. The commit message was right, at least!
> > + cat >> fake-editor.sh <<\EOF
> > +case "$1" in
> > +*/COMMIT_EDITMSG)
> > + test -z "$FAKE_COMMIT_MESSAGE" || echo "$FAKE_COMMIT_MESSAGE" > "$1"
> > + test -z "$FAKE_COMMIT_AMEND" || echo "$FAKE_COMMIT_AMEND" >> "$1"
> > + exit
> > + ;;
> > +esac
> > +test -z "$EXPECT_COUNT" ||
> > + test "$EXPECT_COUNT" = $(sed -e '/^#/d' -e '/^$/d' < "$1" | wc -l) ||
> > + exit
> > +test -z "$FAKE_LINES" && exit
> > +grep -v '^#' < "$1" > "$1".tmp
> > +rm -f "$1"
> > +cat "$1".tmp
> > +action=pick
> > +for line in $FAKE_LINES; do
> > + case $line in
> > + squash|edit)
> > + action="$line";;
> > + *)
> > + echo sed -n "${line}s/^pick/$action/p"
> > + sed -n "${line}p" < "$1".tmp
> > + sed -n "${line}s/^pick/$action/p" < "$1".tmp >> "$1"
>
> I looked at the output from this and wondered what these "sed -n" shown
> in the "-v" output were about last night. I do think it is a good idea
> to show what edit was done to the insn stream, but I suspect it may be
> easier to read the output if you did this instead:
>
> > + sed -n "${line}p" < "$1".tmp
> > + sed -n "${line}s/^pick/$action/p" < "$1".tmp >> "$1"
> > + sed -n "${line}s/^pick/$action/p" < "$1".tmp
Probably. It is for debugging, anyway. As everything you only see with
-v.
Ciao,
Dscho
next prev parent reply other threads:[~2009-01-27 21:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-27 9:29 Heads up: rebase -i -p will be made sane again Johannes Schindelin
2009-01-27 14:54 ` Stephen Haberman
2009-01-27 17:45 ` [PATCH 0/6] Simplifications of some 'rebase' tests Johannes Schindelin
2009-01-27 17:45 ` [PATCH 1/6] t3404 & t3411: undo copy&paste Johannes Schindelin
2009-01-27 21:01 ` Junio C Hamano
2009-01-27 21:57 ` Johannes Schindelin [this message]
2009-01-27 22:46 ` Junio C Hamano
2009-01-27 22:53 ` Johannes Schindelin
2009-01-27 22:34 ` [PATCH v2 0/6] rebase simplifications Johannes Schindelin
2009-01-27 22:50 ` Junio C Hamano
2009-01-27 23:10 ` Johannes Schindelin
2009-01-27 22:34 ` [PATCH v2 1/6] t3404 & t3411: undo copy&paste Johannes Schindelin
2009-01-27 22:34 ` [PATCH v2 2/6] lib-rebase.sh: Document what set_fake_editor() does Johannes Schindelin
2009-01-27 22:34 ` [PATCH v2 3/6] test-lib.sh: introduce test_commit() and test_merge() helpers Johannes Schindelin
2009-01-27 22:34 ` [PATCH v2 4/6] Simplify t3410 Johannes Schindelin
2009-01-27 22:35 ` [PATCH v2 5/6] Simplify t3411 Johannes Schindelin
2009-01-27 22:35 ` [PATCH v2 6/6] Simplify t3412 Johannes Schindelin
2009-01-27 17:46 ` [PATCH 2/6] lib-rebase.sh: Document what set_fake_editor() does Johannes Schindelin
2009-01-27 21:03 ` Junio C Hamano
2009-01-27 21:58 ` Johannes Schindelin
2009-01-27 17:47 ` [PATCH 3/6] lib-rebase.sh: introduce test_commit() and test_merge() helpers Johannes Schindelin
2009-01-27 21:09 ` Junio C Hamano
2009-01-27 17:48 ` [PATCH 4/6] Simplify t3410 Johannes Schindelin
2009-01-27 17:48 ` [PATCH 5/6] Simplify t3411 Johannes Schindelin
2009-01-27 17:49 ` [PATCH 6/6] Simplify t3412 Johannes Schindelin
2009-01-27 17:59 ` Heads up: rebase -i -p will be made sane again Johannes Schindelin
2009-01-28 1:53 ` Johannes Schindelin
2009-01-28 3:39 ` Stephen Haberman
2009-01-28 4:01 ` Johannes Schindelin
2009-01-28 5:21 ` Stephen Haberman
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.1.00.0901272254450.14855@racer \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=stephen@exigencecorp.com \
--cc=trast@student.ethz.ch \
/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