From: Junio C Hamano <gitster@pobox.com>
To: "Grégory Pakosz" <gpakosz@visionobjects.com>
Cc: git@vger.kernel.org
Subject: Re: git filter-branch doesn't dereference annotated tags
Date: Mon, 31 Dec 2012 10:31:43 -0800 [thread overview]
Message-ID: <7vsj6mdqeo.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAC_01E174m_6tDwPKZ5P0BUxnLNWUf9p+VkECFosPTzip0sYsA@mail.gmail.com> ("Grégory Pakosz"'s message of "Mon, 31 Dec 2012 17:24:11 +0100")
Grégory Pakosz <gpakosz@visionobjects.com> 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
working?
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?
next prev parent reply other threads:[~2012-12-31 18:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-31 16:24 git filter-branch doesn't dereference annotated tags Grégory Pakosz
2012-12-31 18:31 ` Junio C Hamano [this message]
2013-01-01 13:11 ` Grégory Pakosz
2013-01-01 19:49 ` Junio C Hamano
2013-01-01 20:20 ` Grégory Pakosz
2013-01-01 21:04 ` Junio C Hamano
2013-01-02 22:03 ` Grégory Pakosz
2013-01-02 23:19 ` Junio C Hamano
2013-01-03 9:38 ` Johannes Sixt
2013-01-03 9:50 ` Grégory Pakosz
2013-01-03 10:33 ` Johannes Sixt
2013-01-03 20:52 ` Brandon Casey
2013-01-01 12:30 ` Johannes Sixt
-- strict thread matches above, loose matches on Subject: below --
2012-12-31 14:36 Grégory Pakosz
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=7vsj6mdqeo.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gpakosz@visionobjects.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).