From: Junio C Hamano <gitster@pobox•com>
To: Ian Campbell <ijc@hellion•org.uk>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 2/2] filter-branch: Handle rewritting (very) old style tags which lack tagger
Date: Tue, 08 Aug 2017 14:00:52 -0700 [thread overview]
Message-ID: <xmqqzib9ai63.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170808080620.9536-2-ijc@hellion.org.uk> (Ian Campbell's message of "Tue, 8 Aug 2017 09:06:20 +0100")
Ian Campbell <ijc@hellion•org.uk> writes:
> Such as v2.6.12-rc2..v2.6.13-rc3 in the Linux kernel source tree.
>
> Insert a fake tag header, since newer `git mktag` wont accept the input
> otherwise:
>
> $ git cat-file tag v2.6.12-rc2
> object 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
> type commit
> tag v2.6.12-rc2
>
> Linux v2.6.12-rc2 release
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQBCbW8ZF3YsRnbiHLsRAgFRAKCq/TkuDaEombFABkPqYgGCgWN2lQCcC0qc
> wznDbFU45A54dZC8RZ5JxyE=
> =ESRP
> -----END PGP SIGNATURE-----
>
> $ git cat-file tag v2.6.12-rc2 | git mktag
> error: char76: could not find "tagger "
> fatal: invalid tag signature file
> $ git cat-file tag v2.6.13-rc4 | git mktag
> 7eab951de91d95875ba34ec4c599f37e1208db93
>
> Signed-off-by: Ian Campbell <ijc@hellion•org.uk>
> ---
> git-filter-branch.sh | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index d07db3fee..6927aa2da 100755
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -540,6 +540,9 @@ if [ "$filter_tag_name" ]; then
> new_sha1=$( ( printf 'object %s\ntype commit\ntag %s\n' \
> "$new_sha1" "$new_ref"
> git cat-file tag "$ref" |
> + awk '/^tagger/ { tagged=1 }
> + /^$/ { if (!tagged && !done) { print "tagger Unknown <unknown@example•com> 0 +0000" } ; done=1 }
> + // { print }' |
> sed -n \
> -e '1,/^$/{
> /^object /d
What the change wants to do makes perfect sense, but piping output
from awk into sed looks somewhat gross. Perhaps we'd want to roll
what the existing sed script is trying to do into this new awk
script?
next prev parent reply other threads:[~2017-08-08 21:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 8:06 [PATCH 0/2] filter-branch: support for incremental update + fix for ancient tag format Ian Campbell
2017-08-08 8:06 ` [PATCH 1/2] filter-branch: Add --state-branch to hold pickled copy of ref map Ian Campbell
2017-08-08 20:56 ` Junio C Hamano
2017-08-09 7:57 ` Ian Campbell
2017-08-08 8:06 ` [PATCH 2/2] filter-branch: Handle rewritting (very) old style tags which lack tagger Ian Campbell
2017-08-08 21:00 ` Junio C Hamano [this message]
2017-08-09 7:43 ` Ian Campbell
2017-08-09 10:20 ` Jeff King
2017-08-09 15:50 ` Junio C Hamano
2017-08-09 19:02 ` Ian Campbell
2017-08-09 19:10 ` Junio C Hamano
2017-08-09 20:23 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqzib9ai63.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=ijc@hellion$(echo .)org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox