Re: [PATCH v2 0/4] push --follow-tags
- From
Jeff King <peff@peff.net>
- Date
- Mar 6, 2013, 08:41 UTC
- Message-ID
- <20130306084105.GB2018@sigill.intra.peff.net>
- In-Reply-To
- <1362523639-30566-1-git-send-email-gitster@pobox.com>
On Tue, Mar 05, 2013 at 02:47:15PM -0800, Junio C Hamano wrote:
> The primary change since the last round is that it pushes out only > annotated tags that are missing from the other side.
Like you, I have mixed feelings on treating annotated tags separately. I don't feel like the previous discussion actually came to a conclusion.
I kind of lean towards the "if we are pushing A..B to a ref, no matter if the remote had the objects already, consider any tag that peels to any commit in A..B". That seems intuitive to me, and reduces the chances of accidentally pushing crufty tags. But I admit it's just a gut feeling.
I think the implementation would just be something like:
for each ref we are pushing
mark ref->old_sha1 as UNINTERESTING
add ref->new_sha1 to pending
traverse pending commits, marking SEEN for each local tag
if tag does not exist on remote &&
commit = lookup_commit_reference_gently(tag) &&
commit->object.flags & SEEN
push tag-Peff