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

Re: [PATCH v2 1/3] gitweb: Cleanup git_print_log()

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 5, 2012, 22:22 UTC
Message-ID
<7vhatlrgp9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1341370046-19913-1-git-send-email-namhyung@kernel.org>
Namhyung Kim <namhyung@kernel.org> writes:
Show 8 quoted lines
> If $signoff set to 1, the $line would be handled in
> the if statement for the both cases. So the outer of
> the conditional always sees the $signoff always set
> to 0 and no need to check it. Thus we can finally get
> rid of it.
>
> Also rename $empty to more clear $skip_blank_line as
> suggested by Junio.

Thanks. It does not make it clear that you fixed a bug in the original, so let me rephrase it like so:

-- >8 --
From: Namhyung Kim <namhyung@kernel.org>
Date: Wed, 4 Jul 2012 11:47:24 +0900
Subject: [PATCH] gitweb: Cleanup git_print_log()

When we see a signed-off-by line (and its friends), we set $signoff to true, but then we process the next line after we are done without giving control to the rest of the loop. And when the line we saw is not a signed-off-by line, we reset $signoff to false before running the remainder of the loop.

Hence, the check for $signoff that attempts to remove an extra empty line between two signed-off-by line was not doing anything useful.

Rename $empty to a more explicit name $skip_blank_line to tell us to skip a blank line when we see one, set it after we see and emit a blank line (to avoid showing more than one empty lines in a raw) or after we handle a signed-off-by line (to avoid empty lines after such a line), to fix this bug, and get rid of the $signoff variable that is not useful.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previous: Junio C Hamano
Message 5 of 5 in “gitweb: Cleanup git_print_log()”
  1. 1/3 gitweb: Cleanup git_print_log()Namhyung Kim, Jul 4, 2012
  2. 2/3 gitweb: Handle other types of tag in git_print_logNamhyung Kim, Jul 4, 2012
  3. 3/3 gitweb: Add support to Link: tagNamhyung Kim, Jul 4, 2012
  4. Junio C HamanoJul 5, 2012
  5. Junio C HamanoJul 5, 2012

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.