Re: bug with git merge-base

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

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

I forgot to say that the behaviour above used by the "fork point"
mode seems to match the behaviour of the more established normal
"merge base" mode.  builtin/merge-base.c::show_merge_base() also
follows the same "die if the input is faulty, give output and
succeed if a merge base is found, otherwise be silent and signal
failure with exit code" pattern.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux