From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: alexander.d.mills@gmail.com, Git List <git@vger.kernel.org>
Subject: Re: bug with git merge-base
Date: Thu, 20 Sep 2018 21:05:33 -0700 [thread overview]
Message-ID: <xmqqsh23xzoy.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAPig+cS+8+uGQTfxmq1XGMt5FBM1oq72d3N=3BkjhrA9ui+EWw@mail.gmail.com> (Eric Sunshine's message of "Thu, 20 Sep 2018 22:31:06 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Wed, Sep 19, 2018 at 6:25 PM Alexander Mills
> <alexander.d.mills@gmail.com> wrote:
>> The following command sequence exits with 1, and no stderr
>>
>> base='remotes/origin/dev';
>> fork_point="$(git merge-base --fork-point "$base")";
>>
>> I cannot figure out why it's exiting with 1, but there is no stdout/stderr
>
> Unable to reproduce the problem. Perhaps you can provide more context.
Well, reading builtin/merge-base.c::handle_fork_point(), I think the
intended behaviour is:
- die() when input is not well formed (e.g. bad commit object,
ambigous ref name, etc.); there is an error worth reporting in
this case.
- show one that used to sit at the tip of the ref, if exists, and
signal success with exit status 0; there of course is no error in
this case.
- if there is no such fork point found, signal failure with exit
status 1; nothing is written to the standard output as there is
no fork point to be shown, and nothing is written to the standard
error.
I do not think the code considers the last case as an error, i.e. it
is just as natural not to have any fork point, as there is one.
It might be OK to teach the command to say "no fork point found" to
the standard error under "--verbose" mode in the last case, but
since the command does not take --verbose or --quiet, I have a
feeling that everything is working as designed.
next prev parent reply other threads:[~2018-09-21 4:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 22:25 bug with git merge-base Alexander Mills
2018-09-21 2:31 ` Eric Sunshine
2018-09-21 4:05 ` Junio C Hamano [this message]
2018-09-21 4:59 ` 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=xmqqsh23xzoy.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=alexander.d.mills@gmail.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.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