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

Re: [PATCH v4 1/2] diff: add --line-prefix option for passing in a prefix

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 11, 2016, 20:55 UTC
Message-ID
<xmqqinv7yqio.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160810231908.26330-1-jacob.e.keller@intel.com>
Subject: SQUASH??? clarify the if/{if/else} nesting
Otherwise GCC helpfully warns you.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 diff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/diff.c b/diff.c
index bfc0a6b..d128b9d 100644
--- a/diff.c
+++ b/diff.c
@@ -1170,11 +1170,12 @@ const char *diff_line_prefix(struct diff_options *opt)
 {
 	struct strbuf *msgbuf;
 
-	if (!opt->output_prefix)
+	if (!opt->output_prefix) {
 		if (opt->line_prefix)
 			return opt->line_prefix;
 		else
 			return "";
+	}
 
 	msgbuf = opt->output_prefix(opt, opt->output_prefix_data);
 	/* line prefix must be printed before the output_prefix() */
-- 
2.9.2-863-g71ed253
Previous: Jacob Keller
Message 8 of 8 in “diff: add --line-prefix option for passing in a prefix”
  1. 1/2 diff: add --line-prefix option for passing in a prefixJacob Keller, Aug 10, 2016
  2. 2/2 diff: add SUBMODULE_DIFF format to display submodule diffJacob Keller, Aug 10, 2016
  3. Junio C HamanoAug 11, 2016
  4. Jacob KellerAug 11, 2016
  5. Junio C HamanoAug 11, 2016
  6. Junio C HamanoAug 11, 2016
  7. Jacob KellerAug 11, 2016
  8. Junio C HamanoAug 11, 2016

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.