diff options
author | Brandon Casey <casey@nrlssc.navy.mil> | 2008-03-26 10:47:09 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-31 00:22:58 -0700 |
commit | 1bf6551e42c79a594689a356a9b14759d55f3cf5 (patch) | |
tree | db5cef209218846e06f4632281654974defa1b3d /t | |
parent | f58dbf23c33e0e79622f4344b48ab5bc9bc360cc (diff) | |
download | git-1bf6551e42c79a594689a356a9b14759d55f3cf5.tar.gz git-1bf6551e42c79a594689a356a9b14759d55f3cf5.tar.xz |
filter-branch.sh: support nearly proper tag name filtering
Add support for creating a new tag object and retaining the tag message,
author, and date when rewriting tags. The gpg signature, if one exists,
will be stripped.
This adds nearly proper tag name filtering to filter-branch. Proper tag
name filtering would include the ability to change the tagger, tag date,
tag message, and _not_ strip a gpg signature if the tag did not change.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7003-filter-branch.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 6827249da..1daaf544d 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -203,4 +203,36 @@ test_expect_success 'Subdirectory filter with disappearing trees' ' test $(git rev-list master | wc -l) = 3 ' +test_expect_success 'Tag name filtering retains tag message' ' + git tag -m atag T && + git cat-file tag T > expect && + git filter-branch -f --tag-name-filter cat && + git cat-file tag T > actual && + git diff expect actual +' + +faux_gpg_tag='object XXXXXX +type commit +tag S +tagger T A Gger <tagger@example.com> 1206026339 -0500 + +This is a faux gpg signed tag. +-----BEGIN PGP SIGNATURE----- +Version: FauxGPG v0.0.0 (FAUX/Linux) + +gdsfoewhxu/6l06f1kxyxhKdZkrcbaiOMtkJUA9ITAc1mlamh0ooasxkH1XwMbYQ +acmwXaWET20H0GeAGP+7vow= +=agpO +-----END PGP SIGNATURE----- +' +test_expect_success 'Tag name filtering strips gpg signature' ' + sha1=$(git rev-parse HEAD) && + sha1t=$(echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | git mktag) && + git update-ref "refs/tags/S" "$sha1t" && + echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | head -n 6 > expect && + git filter-branch -f --tag-name-filter cat && + git cat-file tag S > actual && + git diff expect actual +' + test_done |