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

Re: git filter-branch and merging of signed tags

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 2, 2015, 16:21 UTC
Message-ID
<56378D6F.8080508@drmicha.warpmail.net>
In-Reply-To
<20151102080428.GO4931@pengutronix.de>
Uwe Kleine-König venit, vidit, dixit 02.11.2015 09:04:
Show 114 quoted lines
> Hello,
> 
> Consider I want to rewrite a commit that is a merge of a signed tag. In
> my case that's 064ca93f7ab927c2752d86fc5727716e340d737c that currently
> sits in linux-next:
> 
> 	~/gsrc/linux$ git version
> 	git version 2.6.1
> 	~/gsrc/linux$ git checkout 064ca93f7ab927c2752d86fc5727716e340d737c
> 	~/gsrc/linux$ git cat-file commit HEAD
> 	tree 7086bbd51d06ebd0e3fcca70380d0a066efce6ef
> 	parent e44a01fa0e0aec2f3a21dadb9c030d14831d4258
> 	parent f719a0d6a8541b383c506aaa4b4fa6b4109669f4
> 	author Arnd Bergmann <arnd@arndb.de> 1444139956 +0200
> 	committer Arnd Bergmann <arnd@arndb.de> 1444139956 +0200
> 	mergetag object f719a0d6a8541b383c506aaa4b4fa6b4109669f4
> 	 type commit
> 	 tag efm32-for-4.4-rc1
> 	 tagger Uwe Kleine-König <uwe@kleine-koenig.org> 1443549594 +0200
> 	 
> 	 efm32 cleanups for 4.4-rc1
> 	 
> 	 These are just two followup cleanups for commits that are in v3.17-rc1 and
> 	 waited in my private tree for application since that time.
> 	 -----BEGIN PGP SIGNATURE-----
> 	 
> 	 iQEcBAABCgAGBQJWCtIwAAoJEMH8FHityuwJFPYH/2LJpi0yUhI01s0D9U5rZgjl
> 	 8mLP70utAMaqXiGqP/O0ndH+za5TrrUTwDJE5jhAHru1Q6q62Ld2BfOR5+K8zlrP
> 	 4UDGBDj3ePJgEtbSsJYJIRT+AKque2GONbeGpJh2arPrNamWChKIz8HoGSgwdRlx
> 	 TvQuVFEa6C3ujP0ATM8x54f0vR4bYm9WmBS522DwZQY4JpGZC005A3Quw6fmFxPJ
> 	 vJRo1fE1d2OZ3Cuxb15m8PLtZw6sbMdMwgyirAFGrJsN9u/V6BzsSzH0s8suT7IP
> 	 WIohnmYtFSUfkQjaGrMl2wIpJSsIzettiXf9GrQDXSGZsQ4k7sW3U+qrcZ7ZUR4=
> 	 =ngv1
> 	 -----END PGP SIGNATURE-----
> 
> 	Merge tag 'efm32-for-4.4-rc1' of git://git.pengutronix.de/git/ukl/linux into next/cleanup
> 
> 	Merge "efm32 cleanups for 4.4-rc1" from Uwe Kleine-Koenig:
> 
> 	These are just two followup cleanups for commits that are in v3.17-rc1 and
> 	waited in my private tree for application since that time.
> 
> 	* tag 'efm32-for-4.4-rc1' of git://git.pengutronix.de/git/ukl/linux:
> 	  ARM: efm32: switch to vendor,device compatible strings
> 	  ARM: efm32: switch to properly namespaced location property
> 
> OK, to fix my name in the commit log I do:
> 
> 	 git filter-branch -f --msg-filter "sed 's/Kleine-Koenig/$(echo Kleine-K+APY-nig | iconv -f utf-7 -t utf-8)/'" HEAD ^HEAD^ ^HEAD^2
> 
> This destroys the mergetag, as now I have:
> 
> 	~/gsrc/linux$ git cat-file commit HEAD
> 	tree 7086bbd51d06ebd0e3fcca70380d0a066efce6ef
> 	parent e44a01fa0e0aec2f3a21dadb9c030d14831d4258
> 	parent f719a0d6a8541b383c506aaa4b4fa6b4109669f4
> 	author Arnd Bergmann <arnd@arndb.de> 1444139956 +0200
> 	committer Arnd Bergmann <arnd@arndb.de> 1444139956 +0200
> 
> 	 efm32 cleanups for 4.4-rc1
> 	 
> 	 These are just two followup cleanups for commits that are in v3.17-rc1 and
> 	 waited in my private tree for application since that time.
> 	 -----BEGIN PGP SIGNATURE-----
> 	 
> 	 iQEcBAABCgAGBQJWCtIwAAoJEMH8FHityuwJFPYH/2LJpi0yUhI01s0D9U5rZgjl
> 	 8mLP70utAMaqXiGqP/O0ndH+za5TrrUTwDJE5jhAHru1Q6q62Ld2BfOR5+K8zlrP
> 	 4UDGBDj3ePJgEtbSsJYJIRT+AKque2GONbeGpJh2arPrNamWChKIz8HoGSgwdRlx
> 	 TvQuVFEa6C3ujP0ATM8x54f0vR4bYm9WmBS522DwZQY4JpGZC005A3Quw6fmFxPJ
> 	 vJRo1fE1d2OZ3Cuxb15m8PLtZw6sbMdMwgyirAFGrJsN9u/V6BzsSzH0s8suT7IP
> 	 WIohnmYtFSUfkQjaGrMl2wIpJSsIzettiXf9GrQDXSGZsQ4k7sW3U+qrcZ7ZUR4=
> 	 =ngv1
> 	 -----END PGP SIGNATURE-----
> 
> 	Merge tag 'efm32-for-4.4-rc1' of git://git.pengutronix.de/git/ukl/linux into next/cleanup
> 
> 	Merge "efm32 cleanups for 4.4-rc1" from Uwe Kleine-König:
> 
> 	These are just two followup cleanups for commits that are in v3.17-rc1 and
> 	waited in my private tree for application since that time.
> 
> 	* tag 'efm32-for-4.4-rc1' of git://git.pengutronix.de/git/ukl/linux:
> 	  ARM: efm32: switch to vendor,device compatible strings
> 	  ARM: efm32: switch to properly namespaced location property
> 
> 	~/gsrc/linux$ diff -u <(git cat-file commit HEAD) <(git cat-file commit 064ca93f7ab927c2752d86fc5727716e340d737c)
> 	--- /dev/fd/63	2015-11-02 09:02:17.310373539 +0100
> 	+++ /dev/fd/62	2015-11-02 09:02:17.310373539 +0100
> 	@@ -3,7 +3,11 @@
> 	 parent f719a0d6a8541b383c506aaa4b4fa6b4109669f4
> 	 author Arnd Bergmann <arnd@arndb.de> 1444139956 +0200
> 	 committer Arnd Bergmann <arnd@arndb.de> 1444139956 +0200
> 	-
> 	+mergetag object f719a0d6a8541b383c506aaa4b4fa6b4109669f4
> 	+ type commit
> 	+ tag efm32-for-4.4-rc1
> 	+ tagger Uwe Kleine-König <uwe@kleine-koenig.org> 1443549594 +0200
> 	+ 
> 	  efm32 cleanups for 4.4-rc1
> 	  
> 	  These are just two followup cleanups for commits that are in v3.17-rc1 and
> 	@@ -21,7 +25,7 @@
> 	 
> 	 Merge tag 'efm32-for-4.4-rc1' of git://git.pengutronix.de/git/ukl/linux into next/cleanup
> 	 
> 	-Merge "efm32 cleanups for 4.4-rc1" from Uwe Kleine-König:
> 	+Merge "efm32 cleanups for 4.4-rc1" from Uwe Kleine-Koenig:
> 	 
> 	 These are just two followup cleanups for commits that are in v3.17-rc1 and
> 	 waited in my private tree for application since that time.
> 
> So now the PGP-Signature also appears in the regular commit log. So
> either remove the mergetag info completely or (preferably) keep it
> completely if the merged parent didn't change.

Does your git include a5a4b3f (filter-branch: remove multi-line headers in msg filter, 2015-10-08)? That takes care of the incomplete header tag parsing.

Should be in master by now, I think.

Keeping the mergetag signature would require some extra logic in filter-branch.

Michael
Previous: Uwe Kleine-KönigNext: Uwe Kleine-König
Message 2 of 3 in “git filter-branch and merging of signed tags”
  1. Uwe Kleine-KönigNov 2, 2015
  2. Michael J GruberNov 2, 2015
  3. Uwe Kleine-KönigNov 2, 2015

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.