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

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

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Oct 21, 2010, 07:11 UTC
Message-ID
<20101021071106.GG19834@pengutronix.de>
In-Reply-To
<alpine.LFD.2.00.1010201301130.2764@xanadu.home>
On Wed, Oct 20, 2010 at 01:05:26PM -0400, Nicolas Pitre wrote:
Show 20 quoted lines
> On Wed, 20 Oct 2010, Uwe Kleine-König wrote:
> 
> > On Wed, Oct 20, 2010 at 09:38:14AM -0400, Nicolas Pitre wrote:
> > > On Wed, 20 Oct 2010, Uwe Kleine-König wrote:
> > > 
> > > > If you want I can provide you the broken repo.
> > > 
> > > Yes, please.
> 
> I'm trying to reproduce the exact error you get. But I'm missing some 
> alternates for objects, and none of the trees I have locally provide the 
> needed objects.
> 
> [nico@xanadu linux-2.6]$ ! git format-patch linus/master..sectionmismatches
> 0001-wip-enable-DEBUG_SECTION_MISMATCH.patch
> 0002-ARM-sa1111-move-__sa1111_probe-to-.devinit.text.patch
> 0003-ARM-omap1-nokia770-mark-some-functions-__init.patch
> fatal: unable to read destination tree (16edb8381f2f2dabec9cc59f4a3d8c9ead899668)
> 
> What do you have in your alternate repo?

Hmm, I just unpacked the archive in a seperate directory, removed .git/objects/info/alternates and then git format-patch linus/master..sectionmismatches fails in a different way:

	fatal: Invalid revision range linus/master..sectionmismatches
I guess adding a pristine copy of Linus' tree should do the trick.
[ ... some time later ... creating a fresh clone takes quite some time ... ]
No, that's not enough, I will handpick some objects from the original.

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, 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@pengutronix.de>
	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.

I attached an archive with the two objects 16edb8381f2f2dabec9cc59f4a3d8c9ead899668 and 09b3f464a50111071f7740056b98fa8f36133347 and will try to recreate 40aaeb204dc04d3cf15c060133f65538b43b13b0 now.

Best regards Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Previous: Uwe Kleine-KönigNext: Uwe Kleine-König
Message 10 of 12 in “fetch and bundle don't work in (semi-)broken repo”
  1. Uwe Kleine-KönigOct 19, 2010
  2. Jonathan NiederOct 19, 2010
  3. Uwe Kleine-KönigOct 19, 2010
  4. Nicolas PitreOct 19, 2010
  5. Jonathan NiederOct 19, 2010
  6. Nicolas PitreOct 20, 2010
  7. Uwe Kleine-KönigOct 20, 2010
  8. Nicolas PitreOct 20, 2010
  9. Uwe Kleine-KönigOct 20, 2010
  10. format-patch broken [Was: fetch and bundle don't work in (semi-)broken repo]Uwe Kleine-König, Oct 21, 2010
  11. Uwe Kleine-KönigOct 21, 2010
  12. Nicolas PitreOct 22, 2010

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.