Re: format-patch broken [Was: fetch and bundle don't work in (semi-)broken repo]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 21 Oct 2010, Uwe Kleine-König wrote:

> Ah, you only need 16edb8381f2f2dabec9cc59f4a3d8c9ead899668 to make
> format-patch work, but still 09b3f464a50111071f7740056b98fa8f36133347 is
> missing for this tree.  This doesn't hurt format-patch as it's enough
> for it to know that this entry didn't change.  So format-patch needs
> less information than bundle/fetch and it's OK that the former succeeds
> and the latter fails.

No it is not.  In theory both format-patch and fetch/bundle should 
require the exact same information.

> [...]
> 
> No, that's not the (only) problem,
> 40aaeb204dc04d3cf15c060133f65538b43b13b0 is needed, git format-patch is
> just ignorant enough and invents something different:
> 
> 	username@hostname:~/path/linux-2.6$ git rev-list linus/master..sectionmismatches
> 	eb84720860a90769473b42215a4cb67ee5efe7a7
> 	2e14a5c831032fa489384763087f4a03d88607cb
> 	00b18e8058e98927e2e4eae32deae7e58f47467c
> 	1ad328f663128b5c6e6b4af1ac2da1b443dba530
> 	2a0e4c23a34c78891db685b2b4851705fd36d656
> 	089d061c26b00a5b8dbb9e70b81d36a97e1daded
> 	b7ce4ec88f1bdfbe49fa7ef12df8f985d705605a
> 	b40acb01793933cd6baaaf826f3fef6dd734f72b
> 	780e3d47d067b54b17bcac3794d62825e8e60422
> 	ce06129cf7bbf85afe4fc127afc957d36ba4e9e4
> 	c2172d687578e7eb037a232802a4a8c6de1b0eea
> 	0c23684f39714a72f54036ca2be36e8894794b66
> 	cea2a0668ee1a9dc3617a810954a41c7701a08e9
> 	2bd6ff604ac3aa4c96636dda1ad80a289205ccba
> 	7591700d538d08f2e8327bb439b6cb0488e13f3e
> 
> 	username@hostname:~/path/linux-2.6$ git diff-tree -r 7591700d538d08f2e8327bb439b6cb0488e13f3e
> 	7591700d538d08f2e8327bb439b6cb0488e13f3e
> 	:100644 100644 1b4afd2e6ca089de0babdacc5781426ef118da5c 40aaeb204dc04d3cf15c060133f65538b43b13b0 M	lib/Kconfig.debug
> 
> 	commit 7591700d538d08f2e8327bb439b6cb0488e13f3e
> 	Author: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> 	Date:   Wed Aug 4 08:52:56 2010 +0200
> 
> 	    wip: enable DEBUG_SECTION_MISMATCH
> 
> 	diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> 	index 1b4afd2..40aaeb2 100644
> 	--- a/lib/Kconfig.debug
> 	+++ b/lib/Kconfig.debug
> 	@@ -1,1157 +0,0 @@
> 	-
> 	-config PRINTK_TIME
> 	-	bool "Show timing information on printks"
> 	-	depends on PRINTK
> 	-	help
> 	-	  Selecting this option causes timing information to be
> 	-	  included in printk output.  This allows you to measure
> 	-	  the interval between kernel operations, including bootup
> 	-	  operations.  This is useful for identifying long delays
> 
> So format-patch assumes that lib/Kconfig.debug became empty because of
> not knowing what 40aaeb204dc04d3cf15c060133f65538b43b13b0 is.
> 
> So it's not git-bundle/git-fetch that is broken, but format-patch.

Or rather the low-level diff code.

diff --git a/diff.c b/diff.c
index 4732b32..b2839f9 100644
--- a/diff.c
+++ b/diff.c
@@ -2386,10 +2386,14 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 	}
 	else {
 		enum object_type type;
-		if (size_only)
+		if (size_only) {
 			type = sha1_object_info(s->sha1, &s->size);
-		else {
+			if (type < 0)
+				die("unable to read %s", sha1_to_hex(s->sha1));
+		} else {
 			s->data = read_sha1_file(s->sha1, &type, &s->size);
+			if (!s->data)
+				die("unable to read %s", sha1_to_hex(s->sha1));
 			s->should_free = 1;
 		}
 	}


Nicolas

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]