Re: [BUG] Documentation: git log: --exit-code undocumented?

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

 



On Tue, Dec 02, 2014 at 02:30:31PM +0300, Sergey Organov wrote:
> Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
> > David Kastrup <dak@xxxxxxx> writes:
> >
> >> I disagree that --exit-code does nothing: it indicates whether the
> >> listed log is empty.  So for example
> >>
> >> git log -1 --exit-code a..b > /dev/null
> >>
> >> can be used to figure out whether "a" is a proper ancestor of "b" or
> >> not.
> >
> > Hmph.
> >
> >     $ git log --exit-code master..maint >/dev/null; echo $?
> >     0
> >     $ git log --exit-code maint..master >/dev/null; echo $?
> >     1
> >
> > That is a strange way to use --exit-code.
> 
> What's the best way then to tell if "a" is an ancestor of "b"?

git merge-base --is-ancestor a b
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]