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

Re: [PATCH] fsck: it is OK for a tag and a commit to lack the body

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 29, 2015, 05:12 UTC
Message-ID
<32aa1979e75ba9bc6dc8a58fe32e9e55@www.dscho.org>
In-Reply-To
<xmqqlhf3elxk.fsf_-_@gitster.dls.corp.google.com>
Hi Junio,
On 2015-06-28 20:18, Junio C Hamano wrote:
Show 21 quoted lines
> diff --git a/fsck.c b/fsck.c
> index 88c92e8..3f264e7 100644
> --- a/fsck.c
> +++ b/fsck.c
> @@ -255,6 +255,15 @@ static int require_end_of_header(const void
> *data, unsigned long size,
>  		}
>  	}
>  
> +	/*
> +	 * We did not find double-LF that separates the header
> +	 * and the body.  Not having a body is not a crime but
> +	 * we do want to see the terminating LF for the last header
> +	 * line.
> +	 */
> +	if (size && buffer[size - 1] == '\n')
> +		return 0;
> +
>  	return error_func(obj, FSCK_ERROR, "unterminated header");
>  }
>  
Hmm. Maybe we should still warn when there is no empty line finishing the header explicitly, or at least make it FSCK_IGNORE by default so that maintainers who like a stricter check can upgrade the condition to an error?
Otherwise: ACK.

Ciao, Dscho

Previous: Eric SunshineNext: Junio C Hamano
Message 15 of 19 in “git error in tag ...: unterminated header”
  1. Wolfgang DenkJun 25, 2015
  2. Junio C HamanoJun 25, 2015
  3. Wolfgang DenkJun 25, 2015
  4. Junio C HamanoJun 25, 2015
  5. Johannes SchindelinJun 25, 2015
  6. Junio C HamanoJun 25, 2015
  7. Junio C HamanoJun 25, 2015
  8. Johannes SchindelinJun 26, 2015
  9. Jeff KingJun 26, 2015
  10. Junio C HamanoJun 26, 2015
  11. Johannes SchindelinJun 27, 2015
  12. Junio C HamanoJun 27, 2015
  13. fsck: it is OK for a tag and a commit to lack the bodyJunio C Hamano, Jun 28, 2015
  14. Eric SunshineJun 28, 2015
  15. Johannes SchindelinJun 29, 2015
  16. Junio C HamanoJun 29, 2015
  17. Johannes SchindelinJun 29, 2015
  18. Junio C HamanoJun 25, 2015
  19. Junio C HamanoJun 25, 2015

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.