All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Jerry Zhang <jerry@skydio.com>, git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH V3] git-apply: add --allow-empty flag
Date: Sat, 11 Dec 2021 14:36:10 +0700	[thread overview]
Message-ID: <d8a07706-bbcc-059a-fd1e-6f0e920279a3@gmail.com> (raw)
In-Reply-To: <20211211031343.15818-1-jerry@skydio.com>

On 11/12/21 10.13, Jerry Zhang wrote:
> +--allow-empty::
> +	Don't return error for patches containing no diff. This includes
> +	empty patches and patches with commit text only.
> +

Looks OK.

>   	if (!list && !skipped_patch) {
> -		error(_("unrecognized input"));
> -		res = -128;
> +		if (!state->allow_empty) {
> +			error(_("unrecognized input"));
> +			res = -128;
> +		}
>   		goto end;
>   	}

When we apply empty patch but we forget --allow-empty, we got generic
"unrecognized input". So for this case, we should disambiguate the
former case and case when malformed patch input is provided.

-- 
An old man doll... just what I always wanted! - Clara

  reply	other threads:[~2021-12-11  7:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  1:12 [PATCH] git-apply: allow empty patch text Jerry Zhang
2021-04-27  5:46 ` Eric Wong
2021-04-27  6:28   ` Junio C Hamano
2021-04-27 19:40 ` [PATCH V2] git-apply: add --allow-empty flag Jerry Zhang
2021-04-28  5:08   ` Junio C Hamano
2021-04-28 18:40     ` Jerry Zhang
2021-04-29  0:32   ` Ævar Arnfjörð Bjarmason
2021-12-11  3:13   ` [PATCH V3] " Jerry Zhang
2021-12-11  7:36     ` Bagas Sanjaya [this message]
2021-12-13 20:28     ` [PATCH V4] " Jerry Zhang
2021-12-13 21:44       ` Junio C Hamano
2021-12-13 21:52         ` Jerry Zhang
2021-12-13 21:57           ` 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=d8a07706-bbcc-059a-fd1e-6f0e920279a3@gmail.com \
    --to=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jerry@skydio.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.