public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu•org>
To: Junio C Hamano <gitster@pobox•com>
Cc: Sergey Organov <sorganov@gmail•com>, git@vger•kernel.org
Subject: Re: [BUG] Documentation: git log: --exit-code undocumented?
Date: Mon, 01 Dec 2014 19:30:29 +0100	[thread overview]
Message-ID: <87zjb7jk8q.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <xmqqwq6bp8ey.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Mon, 01 Dec 2014 09:49:25 -0800")

Junio C Hamano <gitster@pobox•com> writes:

> David Kastrup <dak@gnu•org> 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.  I suspect that if you did
> this, you will get 0 from the log between HEAD~..HEAD
>
>     $ git checkout master^0
>     $ git commit --allow-empty -m empty
>     $ git log --exit-code HEAD~..HEAD
>
> even though HEAD~ is a proper ancestor of HEAD, so it is not giving
> us anything useful.  Isn't it a mere artifact that "log" happens to
> share the underlying machinery with "diff" that --exit-code shows a
> non-zero exit when there is any single commit in the range that has
> any change?

Possibly: I haven't checked the underlying code for the details.  At any
rate, it is an option git log accepts for whatever reason.

-- 
David Kastrup

  reply	other threads:[~2014-12-01 18:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 11:50 [BUG] Documentation: git log: --exit-code undocumented? Sergey Organov
2014-12-01 16:29 ` Junio C Hamano
2014-12-01 16:32   ` Sergey Organov
2014-12-01 16:37     ` Junio C Hamano
2014-12-01 16:43       ` Sergey Organov
2014-12-01 17:32   ` David Kastrup
2014-12-01 17:49     ` Junio C Hamano
2014-12-01 18:30       ` David Kastrup [this message]
2014-12-02 11:30       ` Sergey Organov
2014-12-02 12:27         ` John Keeping

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=87zjb7jk8q.fsf@fencepost.gnu.org \
    --to=dak@gnu$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=sorganov@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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