From: Linus Torvalds <torvalds@osdl.org>
To: Petr Baudis <pasky@ucw.cz>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Automerge fix
Date: Mon, 18 Apr 2005 19:48:09 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0504181945400.15725@ppc970.osdl.org> (raw)
In-Reply-To: <20050419010242.GS5554@pasky.ji.cz>
On Tue, 19 Apr 2005, Petr Baudis wrote:
>
> this patch fixes git-merge-one-file-script's automerge.
Nope, it doesn't. The original may not have worked, but neither does your
vesion either: the reason for the exit 1 is that the _script_ should exit,
but when you put it in a sub-shell with (..), now only the subshell exits
with an error code, and we'll happily continue to do the following line
which we should not do (since the merge failed).
> Signed-off-by: Petr Baudis <pasky@ucw.cz>
>
> git-merge-one-file-script: 7ebf5dac4c69043cd2ff89bf7ee552152802f8d1
> --- a/git-merge-one-file-script
> +++ b/git-merge-one-file-script
> @@ -43,7 +43,7 @@ case "${1:-.}${2:-.}${3:-.}" in
> orig=$(unpack-file $1)
> src1=$(unpack-file $2)
> src2=$(unpack-file $3)
> - merge "$src2" "$orig" "$src1" || echo Leaving conflict merge in $src2 && exit 1
> + merge "$src2" "$orig" "$src1" || (echo Leaving conflict merge in $src2 && exit 1)
> cp "$src2" "$4" && update-cache --add -- "$4" && exit 0
What's the right way?
Maybe
if merge "$src2" "$orig" "$src1"
then
cp "$src2" "$4" && update-cache --add -- "$4" && exit 0
fi
echo Leaving conflict merge in $src2
exit 1
would work?
Linus
next prev parent reply other threads:[~2005-04-19 2:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 1:02 [PATCH] Automerge fix Petr Baudis
2005-04-19 2:48 ` Linus Torvalds [this message]
2005-04-19 2:57 ` Petr Baudis
2005-04-19 5:26 ` 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=Pine.LNX.4.58.0504181945400.15725@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
/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).