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

Re: [GIT PULL] sh updates for 2.6.25

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 15, 2008, 18:01 UTC
Message-ID
<alpine.LFD.1.00.0804151048060.2879@woody.linux-foundation.org>
In-Reply-To
<20080415172333.GA29489@linux-sh.org>
On Wed, 16 Apr 2008, Paul Mundt wrote:
>
> Please pull from:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25.git

Paul, your git tree is odd. Not quite corrupt, but it doesn't really follow the rules either.

In particular, it has empty lines at the top of those commits, and I wonder how you created them.

Doing things like "git log" will ignore the spurious empty lines, but they can be seen with things like "git cat-file", eg

	git cat-file commit fd785d6b18b930b76ad5076eed6e9af43195b281 

and I wonder if you used a buggy version of git, or whether you perhaps have some scripts that import these commits from the outside and uses some low-level commands that can generate these kinds of subtly bogus commits.

The reason I noticed is that it screws up the git merge summary, which will take the first line of each commit it merges (_without_ the "skip empty lines" logic) to generate the summary of the merge.

I think we should fix that git merge summary code to allow for this bad behaviour, but I also want to know why such corrupt commits exist in the first place. What toolchain do you use to create that commit? We should fix that too!

Junio? Something like this for the merge summary code? (It also turns an empty commit message with just whitespace in the commit message into the SHA1 hex string)

		Linus
----
 builtin-fmt-merge-msg.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index ebb3f37..7077d52 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -201,6 +201,15 @@ static void shortlog(const char *name, unsigned char *sha1,
 			continue;
 
 		bol = strstr(commit->buffer, "\n\n");
+		if (bol) {
+			unsigned char c;
+			do {
+				c = *++bol;
+			} while (isspace(c));
+			if (!c)
+				bol = NULL;
+		}
+
 		if (!bol) {
 			append_to_list(&subjects, xstrdup(sha1_to_hex(
 							commit->object.sha1)),
@@ -208,7 +217,6 @@ static void shortlog(const char *name, unsigned char *sha1,
 			continue;
 		}
 
-		bol += 2;
 		eol = strchr(bol, '\n');
 		if (eol) {
 			oneline = xmemdupz(bol, eol - bol);
Next: Linus Torvalds
Message 1 of 17 in “Re: [GIT PULL] sh updates for 2.6.25”
  1. Linus TorvaldsApr 15, 2008
  2. Linus TorvaldsApr 15, 2008
  3. Paul MundtApr 15, 2008
  4. Linus TorvaldsApr 15, 2008
  5. Alex RiesenApr 16, 2008
  6. Junio C HamanoApr 16, 2008
  7. Linus TorvaldsApr 16, 2008
  8. Junio C HamanoApr 15, 2008
  9. Jakub NarebskiApr 15, 2008
  10. Miklos VajnaApr 16, 2008
  11. format-patch: Make sure the subject is always a one-linerMiklos Vajna, Apr 16, 2008
  12. Junio C HamanoApr 16, 2008
  13. Miklos VajnaApr 16, 2008
  14. Re* [GIT PULL] sh updates for 2.6.25Junio C Hamano, Apr 16, 2008
  15. Jakub NarebskiApr 16, 2008
  16. Miklos VajnaApr 17, 2008
  17. David WoodhouseApr 27, 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.