git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Monsen <haircut@gmail.com>
To: git@vger.kernel.org
Subject: idea: pruning stale tags
Date: Thu, 10 Mar 2011 09:10:48 -0800	[thread overview]
Message-ID: <4D790618.9000302@gmail.com> (raw)

My idea is to add functionality to git-remote to prune stale tags
(those which no longer exist on the remote). Add a new ui:

git remote prune --tags [-n | --dry-run] <name> [<remote>]

I think it is not possible to know which remote tags originated
from, yes? That's why I suggested adding the [<remote>] parameter;
one would be required to specify the remote to sync with if more
than one remote is configured.

Potential use cases:

* tags change from time to time
* accidentally push a tag with the wrong name
* accidentally push a tag with secret information
* tag naming convention changes (1.0, 1.1, 2.0 -> v1.0, v1.1, v2.0)

...and someone else pulled these "bad" tags, someone that may need
to do "git push --tags" sometime in the future.

The only workaround I'm aware of in this situation is to try to
alert everyone with clones who may eventually need to run "git push
--tags" to manually delete specific tags from their clones.

I acknowledge that the use cases are probably contrived/uncommon.
Yes, tags are meant to be forever. But mistakes happen, and maybe
not everyone uses tags the way they were anticipated to be used.

Maybe there's already a suitable workaround better than asking
everyone to manually delete tags? If so, please let me know. I'd
rather do that than advocate adding more complexity to git.

Here is a *little* evidence that I'm not the only one with this
silly idea. Here's a thread on stackoverflow covering the first
use case above (tags change from time to time):

http://stackoverflow.com/questions/1841341/git-remove-local-tags-that-are-no-longer-on-the-remote-repository

And these look like custom scripts to "sync" local tags with those
on a remote:

https://github.com/kigster/git_scripts/blob/master/bin/git-sync-local-tags
https://gist.github.com/345031

Thoughts?

             reply	other threads:[~2011-03-10 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 17:10 Adam Monsen [this message]
2011-03-11 14:48 ` idea: pruning stale tags Marc Branchaud

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=4D790618.9000302@gmail.com \
    --to=haircut@gmail.com \
    --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).