git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH V3] git-apply: add --allow-empty flag

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Dec 11, 2021, 07:36 UTC
Message-ID
<d8a07706-bbcc-059a-fd1e-6f0e920279a3@gmail.com>
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.
Show 9 quoted lines
>   	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
Previous: Jerry ZhangNext: Jerry Zhang
Message 9 of 13 in “git-apply: allow empty patch text”
  1. git-apply: allow empty patch textJerry Zhang, Apr 27, 2021
  2. Eric WongApr 27, 2021
  3. Junio C HamanoApr 27, 2021
  4. git-apply: add --allow-empty flagJerry Zhang, Apr 27, 2021
  5. Junio C HamanoApr 28, 2021
  6. Jerry ZhangApr 28, 2021
  7. Ævar Arnfjörð BjarmasonApr 29, 2021
  8. git-apply: add --allow-empty flagJerry Zhang, Dec 11, 2021
  9. Bagas SanjayaDec 11, 2021
  10. git-apply: add --allow-empty flagJerry Zhang, Dec 13, 2021
  11. Junio C HamanoDec 13, 2021
  12. Jerry ZhangDec 13, 2021
  13. Junio C HamanoDec 13, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.