summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2008-08-07 23:50:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-08 23:19:51 (GMT)
commit261044e85ddac3de48dc74dd9c416c95147022ad (patch)
treef1d605edbe9b7cc93b391c925d9c4b3c697cf0bc /git-filter-branch.sh
parent8afa42101d14f8944c1eb7f2e54d4f5300d2bb73 (diff)
downloadgit-261044e85ddac3de48dc74dd9c416c95147022ad.zip
git-261044e85ddac3de48dc74dd9c416c95147022ad.tar.gz
git-261044e85ddac3de48dc74dd9c416c95147022ad.tar.bz2
filter-branch: be more helpful when an annotated tag changes
Previously, git-filter-branch failed if it attempted to update an annotated tag. Now we ignore this condition if --tag-name-filter is given, so that we can later rewrite the tag. If no such option was provided, we warn the user that he might want to run with "--tag-name-filter cat" to achieve the intended effect. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 182822a..a324cf0 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -361,9 +361,17 @@ do
;;
$_x40)
echo "Ref '$ref' was rewritten"
- git update-ref -m "filter-branch: rewrite" \
- "$ref" $rewritten $sha1 ||
- die "Could not rewrite $ref"
+ if ! git update-ref -m "filter-branch: rewrite" \
+ "$ref" $rewritten $sha1 2>/dev/null; then
+ if test $(git cat-file -t "$ref") = tag; then
+ if test -z "$filter_tag_name"; then
+ warn "WARNING: You said to rewrite tagged commits, but not the corresponding tag."
+ warn "WARNING: Perhaps use '--tag-name-filter cat' to rewrite the tag."
+ fi
+ else
+ die "Could not rewrite $ref"
+ fi
+ fi
;;
*)
# NEEDSWORK: possibly add -Werror, making this an error