From: Junio C Hamano <gitster@pobox.com>
To: Rolf Leggewie <foss@rolf.leggewie.biz>
Cc: git@vger.kernel.org
Subject: Re: prevent push of irrelevant tags
Date: Thu, 12 Apr 2012 13:07:11 -0700 [thread overview]
Message-ID: <7v1uns67f4.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4F873153.9060004@rolf.leggewie.biz> (Rolf Leggewie's message of "Fri, 13 Apr 2012 03:47:31 +0800")
Rolf Leggewie <foss@rolf.leggewie.biz> writes:
> I just ran into the situation that "git push --tags" pushed tags to the
> remote repo that point to commits that do not exist there. How can this
> happen?
The "--tags" option is to request to push every ref under refs/tags/
hierarchy, so the answer is "because the user asked to".
> Git has the information to know...
No, it doesn't.
> that tag X will be useless in repo Y
> because the commit Z it points to does not exist in Y.
Think of a case where:
1. You have cloned from your origin.
2. You built history on top of your 'master' branch, and pushed the
result. The 'master' at your origin now points at this commit.
3. Somebody working on the project cloned from the same origin, built
some history, and pushed the result. The 'master' at your origin is
again updated to point at this commit (which is a descendant of the
commit you made in #2).
4. You tagged the tip of your 'master' as v1.0.
5. You give the magic "--relevant-tags-only" option to your "git push".
Now what happens?
The only two things your "git push" knows are that your origin does not
have v1.0 tag, and that its 'master' branch points at the commit created
by somebody else at #3. Most importantly, it does not have the history
leading to this commit ("push" never fetches); it does not have a way to
tell if it is a descendant of commit you created in #2. In other words,
the magic "--relevant-tags-only" is fundamentally flawed as a concept.
next prev parent reply other threads:[~2012-04-12 20:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 19:47 prevent push of irrelevant tags Rolf Leggewie
2012-04-12 20:07 ` Junio C Hamano [this message]
2012-04-12 20:45 ` Rolf Leggewie
2012-04-12 20:34 ` Andreas Schwab
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v1uns67f4.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=foss@rolf.leggewie.biz \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).