All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Andriy Gapon <avg@FreeBSD.org>
Cc: git@vger.kernel.org, Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: Bug in git rebase --continue in v1.8.4
Date: Wed, 04 Sep 2013 13:56:18 +0200	[thread overview]
Message-ID: <vpq61ug6brx.fsf@anie.imag.fr> (raw)
In-Reply-To: <5226FA92.5060709@FreeBSD.org> (Andriy Gapon's message of "Wed, 04 Sep 2013 12:17:06 +0300")

Andriy Gapon <avg@FreeBSD.org> writes:

> This looks like bug in FreeBSD shell indeed.

Yes: the testsuite would have caught it otherwise.

> If a script is sourced within a function scope, then 'return' in the script
> causes the function to return.  But it should cause the sourced script to return.

OK, so this is FreeBSD's fault. But that should not prevent us from
fixing Git to make it work with FreeBSD.

Does the patch below fix the testsuite for you?

--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -167,13 +167,22 @@ You can run "git stash pop" or "git stash drop" at any time.
        rm -rf "$state_dir"
 }
 
-run_specific_rebase () {
+run_specific_rebase_internal () {
        if [ "$interactive_rebase" = implied ]; then
                GIT_EDITOR=:
                export GIT_EDITOR
                autosquash=
        fi
+       # On FreeBSD, the shell's "return" returns from the current
+       # function, not from the current file inclusion.
+       # run_specific_rebase_internal has the file inclusion as a
+       # last statement, so POSIX and FreeBSD's return will do the
+       # same thing.
        . git-rebase--$type
+}
+
+run_specific_rebase () {
+       run_specific_rebase_internal
        ret=$?
        if test $ret -eq 0
        then


-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

      reply	other threads:[~2013-09-04 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31 12:49 Bug in git rebase --continue in v1.8.4 Christoph Mallon
2013-09-04  8:02 ` Andriy Gapon
2013-09-04  8:18   ` Matthieu Moy
2013-09-04  8:53     ` Andriy Gapon
2013-09-04  9:17       ` Andriy Gapon
2013-09-04 11:56         ` Matthieu Moy [this message]

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=vpq61ug6brx.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=artagnon@gmail.com \
    --cc=avg@FreeBSD.org \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.