From: Sergey Organov Date: Tue, 02 Dec 2014 11:30:31 GMT Subject: Re: [BUG] Documentation: git log: --exit-code undocumented? Message-ID: <87ppc2xp9k.fsf@osv.gnss.ru> In-Reply-To: Junio C Hamano writes: > David Kastrup 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"? -- Sergey.