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

Re: Problems with binary patches (pull) and spaces in filenames (gitk)

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 9, 2005, 22:10 UTC
Message-ID
<Pine.LNX.4.64.0511091404000.4627@g5.osdl.org>
In-Reply-To
<20051109213730.GA23052@ebar091.ebar.dtu.dk>
On Wed, 9 Nov 2005, Peter Eriksen wrote:
Show 9 quoted lines
> 
> 1) When pulling an updated binary files, I guess it still tries to 
>    print this update summary by making and processing patches, and so
>    gives this error:
> 
>        Updating from ab1c4033ba98c043e13da3446e7f244ac7f79942 to
>        c164231f6b59fd80171e95f31d762a80d884c708.
>        Fast forward
>        fatal: patch with only garbage at line 3249
Yes, this is "git-apply --stat" being unhappy about an empty patch.

Maybe we should only be unhappy when actually trying to apply (or check) the patch.

So a patch like the appended may or may not be the right solution.
> 2) When there are spaces in filenames, gitk only shows the first part of
>    the name in the filelist at the buttom right.
Can't help you there, that's more tcl/tk than I know. Paul?
		Linus
---
diff --git a/apply.c b/apply.c
index 3e53b34..da1416a 100644
--- a/apply.c
+++ b/apply.c
@@ -890,7 +890,7 @@ static int parse_chunk(char *buffer, uns
 
 	patchsize = parse_single_patch(buffer + offset + hdrsize, size - offset - hdrsize, patch);
 
-	if (!patchsize && !metadata_changes(patch))
+	if ((check ||apply) && !patchsize && !metadata_changes(patch))
 		die("patch with only garbage at line %d", linenr);
 
 	return offset + hdrsize + patchsize;
Previous: Jan Harkes
Message 6 of 6 in “Problems with binary patches (pull) and spaces in filenames (gitk)”
  1. Peter EriksenNov 9, 2005
  2. Junio C HamanoNov 9, 2005
  3. Junio C HamanoNov 9, 2005
  4. Peter EriksenNov 9, 2005
  5. Jan HarkesNov 9, 2005
  6. Linus TorvaldsNov 9, 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.