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

Re: ALSA official git repository

From
Sean <seanlkml@sympatico.ca>
Date
May 27, 2005, 17:00 UTC
Message-ID
<3516.10.10.10.24.1117213207.squirrel@linux1>
In-Reply-To
<Pine.LNX.4.58.0505270903230.17402@ppc970.osdl.org>
On Fri, May 27, 2005 12:13 pm, Linus Torvalds said:
Show 17 quoted lines
> On Fri, 27 May 2005, Jaroslav Kysela wrote:
>>
>> 	I created new git tree for the ALSA project at:
>>
>> rsync://rsync.kernel.org/pub/scm/linux/kernel/git/perex/alsa.git
>
> Your scripts(?) to generate these things are a bit strange, since they
> leave an extra empty line in the commit message, which confuses at least
> gitweb (ie just look at
>
>    http://www.kernel.org/git/?p=linux/kernel/git/perex/alsa.git;a=summary
>
> and note how the summary thing looks empty).
>
> Now, arguably gitweb should ignore whitespace at the beginning, but
> equally arguably your commits shouldn't have them either...
>
Perhaps git should enforce this?  Patch attached.
Remove leading empty lines from commit messages.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>

--- raw/commit-tree.c 2005-05-26 23:38:30.000000000 -0400 +++ argp2/commit-tree.c 2005-05-27 12:46:54.000000000 -0400

@@ -90,6 +90,18 @@
 	free(buf);
 }
 
+static int whitespace(const char *msg) 
+{
+	while (*msg) 
+		switch (*msg) {
+		case ' ': case '\t': case '\n': case '\r':
+			msg++; break;
+		default:
+			return 0;
+		}
+	return 1;
+}
+
 /*
  * Having more than two parents is not strange at all, and this is
  * how multi-way merges are represented.
@@ -112,7 +124,7 @@
 	char comment[1000];
 	struct passwd *pw;
 	char *buffer;
-	unsigned int size;
+	unsigned int size, csize;
 
 	if (argc < 2 || get_sha1_hex(argv[1], tree_sha1) < 0)
 		usage(commit_tree_usage);
@@ -174,8 +186,10 @@
 	add_buffer(&buffer, &size, "committer %s <%s> %s\n\n", commitgecos, commitemail, realdate);
 
 	/* And add the comment */
+	csize = size;
 	while (fgets(comment, sizeof(comment), stdin) != NULL)
-		add_buffer(&buffer, &size, "%s", comment);
+		if (size > csize || ! whitespace(comment))
+			add_buffer(&buffer, &size, "%s", comment);
 
 	write_sha1_file(buffer, size, "commit", commit_sha1);
 	printf("%s\n", sha1_to_hex(commit_sha1));
Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 15 in “Re: ALSA official git repository”
  1. Linus TorvaldsMay 27, 2005
  2. SeanMay 27, 2005
  3. Linus TorvaldsMay 27, 2005
  4. Junio C HamanoMay 27, 2005
  5. Jaroslav KyselaMay 27, 2005
  6. Linus TorvaldsMay 27, 2005
  7. Andrew MortonMay 27, 2005
  8. Junio C HamanoMay 27, 2005
  9. Jesper JuhlMay 27, 2005
  10. SchneelockeMay 27, 2005
  11. Linus TorvaldsMay 27, 2005
  12. Andrew MortonMay 27, 2005
  13. Linus TorvaldsMay 28, 2005
  14. Chris WedgwoodMay 28, 2005
  15. Jaroslav KyselaMay 29, 2005

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.