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

Re: [PATCH 0/1] Diff-helper update

From
Junio C Hamano <junkio@cox.net>
Date
May 18, 2005, 20:30 UTC
Message-ID
<7vll6cnup4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0505181134470.18337@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> I took the liberty of doing just that. The only subtle issue was that LT> the strbuf functions would consider an empty line to be EOF, which looked LT> wrong and unintentional. Fixing that made the actual diff-helper changes LT> totally trivial, and I can now do LT> git-rev-list HEAD | git-diff-tree -r -v --stdin | ./git-diff-helper -r | less -S LT> and it does the right thing for me.

Thanks for fixing up strbuf.
@@ -136,8 +268,12 @@ int main(int ac, const char **av) {
 		if (sb.eof)
 			break;
 		status = parse_diff_raw_output(sb.buf, av+1, ac-1, reverse);
-		if (status)
-			fprintf(stderr, "cannot parse %s\n", sb.buf);
+		if (status) {
+			flush_renames(av+1, ac-1, reverse);
+			printf("%s%c", sb.buf, line_termination);
+		}
 	}
+
+	flush_renames(av+1, ac-1, reverse);
 	return 0;
 }

I suspect doing something like this might be saner instead,
assuming non raw-diffs come at the end.  

		if (status)
			break;
	}
	flush_renames(av+1, ac-1, reverse);
	if (!sb.eof) {
        	spit out what we have in sb.eof, sendfile ;-) the
                rest of the input to the output.
	}
	return 0;
Previous: Thomas GlanzmannNext: Linus Torvalds
Message 7 of 13 in “Diff-helper update”
  1. 0/1 Diff-helper updateJunio C Hamano, May 18, 2005
  2. Linus TorvaldsMay 18, 2005
  3. Junio C HamanoMay 18, 2005
  4. Linus TorvaldsMay 18, 2005
  5. Linus TorvaldsMay 18, 2005
  6. Thomas GlanzmannMay 18, 2005
  7. Junio C HamanoMay 18, 2005
  8. Linus TorvaldsMay 18, 2005
  9. Junio C HamanoMay 18, 2005
  10. Junio C HamanoMay 19, 2005
  11. [preview] diff-helper rename detection.Junio C Hamano, May 19, 2005
  12. Linus TorvaldsMay 19, 2005
  13. Junio C HamanoMay 19, 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.