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

[PATCH] Avoid ugly linewrap in git help

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Feb 11, 2007, 13:29 UTC
Message-ID
<45CF1A56.1060809@lsrfire.ath.cx>

Some of the short help texts that are shown e.g. when running 'git' without any parameters wrap on a 80-column terminal. They are just one character over the line. This patch avoids it by decreasing the number of spaces around the preceding command name from four to three (on both sides for symmetry).

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 help.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/help.c b/help.c
index 341b9e3..b667463 100644
--- a/help.c
+++ b/help.c
@@ -168,8 +168,8 @@ static void list_common_cmds_help(void)
 
 	puts("The most commonly used git commands are:");
 	for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
-		printf("    %s", common_cmds[i].name);
-		mput_char(' ', longest - strlen(common_cmds[i].name) + 4);
+		printf("   %s   ", common_cmds[i].name);
+		mput_char(' ', longest - strlen(common_cmds[i].name));
 		puts(common_cmds[i].help);
 	}
 	puts("(use 'git help -a' to get a list of all installed git commands)");
Next: Junio C Hamano
Message 1 of 2 in “Avoid ugly linewrap in git help”
  1. Avoid ugly linewrap in git helpRené Scharfe, Feb 11, 2007
  2. Junio C HamanoFeb 11, 2007

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.