From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Peter Valdemar Mørch (Lists)" <4ux6as402@sneakemail.com>,
git@vger.kernel.org
Subject: Re: Re* git diff/log --check exitcode and PAGER environment variable
Date: Fri, 08 Aug 2008 13:40:02 -0700 [thread overview]
Message-ID: <7vsktfb5r1.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0808081315060.9611@pacific.mpi-cbg.de.mpi-cbg.de> (Johannes Schindelin's message of "Fri, 8 Aug 2008 13:23:03 +0200 (CEST)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Fri, 8 Aug 2008, "Peter Valdemar Mørch (Lists)" wrote:
>
>> I don't want to be a troll... But in my original post, I write that git
>> log exits with 0 even when there are --check failures *and* --no-pager
>> is used.
>
> You seem to care enough. That is good. Because I will give you a few
> pointers to help yourself, and you can in return help us by submitting a
> patch:
>
> - the code to be changed lives in log-tree.c. Look for calls to the
> function log_tree_diff_flush(). You need to check the exit status
> after that (needs to be done only when DIFF_OPT_TST(opt->diffopt,
> EXIT_WITH_STATUS).
>
> - you can get at the exit status with the call
> diff_result_code(opt->diffopt, 0) (see the implementation in diff.c to
> find out what the 0 means, and why it is correct).
>
> - you need to accumulate the exit status (plural, with a long u) over all
> calls to log_tree_diff(), best thing would be to add a member to the
> log_info struct.
>
> - you need to test rev->loginfo->exit_code in the end, and return failure
> if it is non-zero. I think the place is in cmd_log_walk().
>
> Bon chance,
> Dscho
Dscho, thanks for a nice writeup.
And sorry, Peter, for being dense earlier.
I somehow thought you were talking about "diff" but you are right; "log"
has been solely used for "_view_ log with various format of diffs" and
nobody wanted it to pay attention to individual diff's exit status so far
(I am not saying "everybody wanted it not to pay attention to it" -- it
was just nobody felt the need for log to report the diff exit status).
next prev parent reply other threads:[~2008-08-08 20:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 9:39 git diff/log --check exitcode and PAGER environment variable "Peter Valdemar Mørch (Lists)"
2008-08-08 9:44 ` Junio C Hamano
2008-08-08 10:04 ` "Peter Valdemar Mørch (Lists)"
2008-08-08 10:15 ` Re* " Junio C Hamano
2008-08-08 11:02 ` "Peter Valdemar Mørch (Lists)"
2008-08-08 11:23 ` Johannes Schindelin
2008-08-08 20:40 ` Junio C Hamano [this message]
2008-08-09 6:57 ` [PATCH] Teach git log --check to return an appropriate error code Peter Valdemar Mørch
2008-08-09 12:05 ` Johannes Schindelin
2008-08-09 19:29 ` Junio C Hamano
2008-08-10 17:05 ` "Peter Valdemar Mørch (Lists)"
2008-08-10 18:40 ` Junio C Hamano
2008-08-09 18:58 ` Junio C Hamano
2008-08-11 6:46 ` PATCH v2 0/2 Trying patch again Peter Valdemar Mørch
2008-08-11 6:46 ` [PATCH v2 1/2] Teach git log --check to return an appropriate exit code Peter Valdemar Mørch
2008-08-11 6:46 ` [PATCH v2 2/2] Teach git log --exit-code " Peter Valdemar Mørch
2008-08-08 13:17 ` git diff/log --check exitcode and PAGER environment variable Jeff King
2008-08-08 13:19 ` Jeff King
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=7vsktfb5r1.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=4ux6as402@sneakemail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).