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

Re: [PATCH 1/4] fix whitespace violations in test scripts

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2008, 07:20 UTC
Message-ID
<7v1w30iisy.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080614065119.GA9006@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
> index d24a47d..7cdd70a 100755
> --- a/t/t1502-rev-parse-parseopt.sh
> +++ b/t/t1502-rev-parse-parseopt.sh
> @@ -5,7 +5,7 @@ test_description='test git rev-parse --parseopt'
>  
>  cat > expect.err <<EOF
>  usage: some-command [options] <args>...
> -    
> +
>      some-command does foo and bar!
>  
>      -h, --help            show the help
This part unfortunately falls into the same category as your [3/4].
---
 parse-options.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index acf3fe3..5e56bb5 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -312,8 +312,12 @@ void usage_with_options_internal(const char * const *usagestr,
 	fprintf(stderr, "usage: %s\n", *usagestr++);
 	while (*usagestr && **usagestr)
 		fprintf(stderr, "   or: %s\n", *usagestr++);
-	while (*usagestr)
-		fprintf(stderr, "    %s\n", *usagestr++);
+	while (*usagestr) {
+		if (**usagestr)
+			fprintf(stderr, "    %s", *usagestr);
+		putc('\n', stderr);
+		usagestr++;
+	}
 
 	if (opts->type != OPTION_GROUP)
 		fputc('\n', stderr);
Previous: Jeff KingNext: Jeff King
Message 8 of 19 in “t/.gitattributes: only ignore whitespace errors in test files”
  1. t/.gitattributes: only ignore whitespace errors in test filesLea Wiemann, Jun 12, 2008
  2. Jeff KingJun 13, 2008
  3. t/.gitattributes: only ignore whitespace errors in test filesLea Wiemann, Jun 13, 2008
  4. Junio C HamanoJun 13, 2008
  5. Jeff KingJun 14, 2008
  6. 1/4 fix whitespace violations in test scriptsJeff King, Jun 14, 2008
  7. Jeff KingJun 14, 2008
  8. Junio C HamanoJun 14, 2008
  9. Jeff KingJun 14, 2008
  10. 1/5 fix whitespace violations in test scriptsJeff King, Jun 14, 2008
  11. 2/5 mask necessary whitespace policy violations in test scriptsJeff King, Jun 14, 2008
  12. 3/5 avoid whitespace on empty line in automatic usage messageJeff King, Jun 14, 2008
  13. 4/5 avoid trailing whitespace in zero-change diffstat linesJeff King, Jun 14, 2008
  14. 5/5 enable whitespace checking of test scriptsJeff King, Jun 14, 2008
  15. 2/4 mask necessary whitespace policy violations in test scriptsJeff King, Jun 14, 2008
  16. 3/4 avoid trailing whitespace in zero-change diffstat linesJeff King, Jun 14, 2008
  17. Junio C HamanoJun 14, 2008
  18. Jeff KingJun 14, 2008
  19. 4/4 enable whitespace checking of test scriptsJeff King, Jun 14, 2008

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.