git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Denton Liu <liu.denton@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git-diff.txt: document return code of `--no-index`
Date: Tue, 29 Oct 2019 14:06:38 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1910291405090.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <3f6d132663cacde01df68bfe88c6ef108cf6cf74.1572337045.git.liu.denton@gmail.com>

Hi Denton,

On Tue, 29 Oct 2019, Denton Liu wrote:

> According to the end of diff_no_index(),
>
> 	/*
> 	 * The return code for --no-index imitates diff(1):
> 	 * 0 = no changes, 1 = changes, else error
> 	 */
> 	return diff_result_code(&revs->diffopt, 0);
>
> However, this is not properly documented in git-diff.txt.
>
> Shamelessly steal from the `--exit-code` text and give it to the
> `--no-index` documentation to explain that the return code is similar to
> diff(1).

Speaking of `--exit-code`...

> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  Documentation/git-diff.txt | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
> index 72179d993c..1e363bd200 100644
> --- a/Documentation/git-diff.txt
> +++ b/Documentation/git-diff.txt
> @@ -36,7 +36,10 @@ two blob objects, or changes between two files on disk.
>  	running the command in a working tree controlled by Git and
>  	at least one of the paths points outside the working tree,
>  	or when running the command outside a working tree
> -	controlled by Git.
> +	controlled by Git. With `--no-index`,
> +	the program exits with codes similar to diff(1). That is, it
> +	exits with 1 if there were differences and 0 means no
> +	differences.

... a shorter alternative would be to state: This implies `--exit-code`.

Ciao,
Dscho

>
>  'git diff' [<options>] --cached [<commit>] [--] [<path>...]::
>
> --
> 2.24.0.rc0.197.g0926ab8072
>
>

  reply	other threads:[~2019-10-29 13:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  8:19 Denton Liu
2019-10-29 13:06 ` Johannes Schindelin [this message]
2019-10-30  2:08   ` Junio C Hamano
2019-10-29 16:54 ` [PATCH v2] " Denton Liu
2019-10-30 10:11   ` Phillip Wood
2019-10-30 22:02     ` Johannes Schindelin
2019-10-30 22:12       ` Denton Liu
2019-10-30 18:06   ` [PATCH v3] " Denton Liu
2019-11-02  4:17     ` Junio C Hamano

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=nycvar.QRO.7.76.6.1910291405090.46@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --subject='Re: [PATCH] git-diff.txt: document return code of `--no-index`' \
    /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

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