From: Ian Campbell <ijc@hellion.org.uk>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Ian Campbell <ijc@hellion.org.uk>
Subject: [PATCH v3 4/4] filter-branch: use hash-object instead of mktag
Date: Thu, 21 Sep 2017 08:49:32 +0100 [thread overview]
Message-ID: <20170921074932.5490-4-ijc@hellion.org.uk> (raw)
In-Reply-To: <1505980146.4636.9.camel@hellion.org.uk>
This allows us to recreate even historical tags which would now be consider
invalid, such as v2.6.12-rc2..v2.6.13-rc3 in the Linux kernel source tree which
lack the `tagger` header.
$ git rev-parse v2.6.12-rc2
9e734775f7c22d2f89943ad6c745571f1930105f
$ 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.12-rc2 | git hash-object -t tag -w --stdin
9e734775f7c22d2f89943ad6c745571f1930105f
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
---
git-filter-branch.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 956869b8e..3365a3b86 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -561,7 +561,7 @@ if [ "$filter_tag_name" ]; then
}' \
-e '/^-----BEGIN PGP SIGNATURE-----/q' \
-e 'p' ) |
- git mktag) ||
+ git hash-object -t tag -w --stdin) ||
die "Could not create new tag object for $ref"
if git cat-file tag "$ref" | \
sane_grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1
--
2.11.0
next prev parent reply other threads:[~2017-09-21 7:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 7:49 [PATCH v3 0/4] filter-branch: support for incremental update + fix for ancient tag format Ian Campbell
2017-09-21 7:49 ` [PATCH v3 1/4] filter-branch: reset $GIT_* before cleaning up Ian Campbell
2017-09-21 7:49 ` [PATCH v3 2/4] filter-branch: preserve and restore $GIT_AUTHOR_* and $GIT_COMMITTER_* Ian Campbell
2017-09-21 7:49 ` [PATCH v3 3/4] filter-branch: stash away ref map in a branch Ian Campbell
2017-09-21 7:49 ` Ian Campbell [this message]
2017-09-22 4:42 ` [PATCH v3 0/4] filter-branch: support for incremental update + fix for ancient tag format Junio C Hamano
2017-09-22 8:38 ` Ian Campbell
2017-09-22 8:58 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170921074932.5490-4-ijc@hellion.org.uk \
--to=ijc@hellion.org.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).