Grégory Pakosz <> writes:

>   1) either make git-filter-branch dereference annotated tags and do
> the verification itself then use the two arguments version of git
> update-ref
>   2) in the case of an annotated tag, pass another <old value> to git 
> update-ref
> Please find below a patch that implements solution 1).
> ...
>               echo "Ref '$ref' was deleted"
> -             git update-ref -m "filter-branch: delete" -d "$ref" $sha1 ||
> +             test $(git rev-parse --verify "$ref^{commit}") = $sha1 && git
> update-ref -m "filter-branch: delete" -d "$ref" ||

Thanks.  A few comments.

At the design level.  Where does this $sha1 come from in the first
place?  If a ref that named the annotated tag was deleted, shouldn't
we arrange things so this part of the code receives the $sha1 of the
tag that corresponds to the $ref so that "update-ref -d" can check
that nobody tampered with the repository while the script was

At the implementation level.  When the ref being deleted pointed at
a tree or a blob, the original would have correctly removed it, but
will the updated one?
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to