{"thread":{"id":"26704","subject":"idea: pruning stale tags","startedAt":"2011-03-10T17:10:48Z","lastAt":"2011-03-11T14:48:31Z","messageCount":2,"participants":["Adam Monsen","Marc Branchaud"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"163155","messageId":"4D790618.9000302@gmail.com","threadId":"26704","inReplyTo":null,"subject":"idea: pruning stale tags","fromName":"Adam Monsen","fromEmail":"haircut@gmail.com","sentAt":"2011-03-10T17:10:48Z","receivedAt":"2011-03-10T17:10:48Z","isPatch":false,"sender":{"key":"haircut@gmail.com","avatar":"https://avatars.githubusercontent.com/u/50639?v=4"},"body":"My idea is to add functionality to git-remote to prune stale tags\n(those which no longer exist on the remote). Add a new ui:\n\ngit remote prune --tags [-n | --dry-run] <name> [<remote>]\n\nI think it is not possible to know which remote tags originated\nfrom, yes? That's why I suggested adding the [<remote>] parameter;\none would be required to specify the remote to sync with if more\nthan one remote is configured.\n\nPotential use cases:\n\n* tags change from time to time\n* accidentally push a tag with the wrong name\n* accidentally push a tag with secret information\n* tag naming convention changes (1.0, 1.1, 2.0 -> v1.0, v1.1, v2.0)\n\n...and someone else pulled these \"bad\" tags, someone that may need\nto do \"git push --tags\" sometime in the future.\n\nThe only workaround I'm aware of in this situation is to try to\nalert everyone with clones who may eventually need to run \"git push\n--tags\" to manually delete specific tags from their clones.\n\nI acknowledge that the use cases are probably contrived/uncommon.\nYes, tags are meant to be forever. But mistakes happen, and maybe\nnot everyone uses tags the way they were anticipated to be used.\n\nMaybe there's already a suitable workaround better than asking\neveryone to manually delete tags? If so, please let me know. I'd\nrather do that than advocate adding more complexity to git.\n\nHere is a *little* evidence that I'm not the only one with this\nsilly idea. Here's a thread on stackoverflow covering the first\nuse case above (tags change from time to time):\n\nhttp://stackoverflow.com/questions/1841341/git-remove-local-tags-that-are-no-longer-on-the-remote-repository\n\nAnd these look like custom scripts to \"sync\" local tags with those\non a remote:\n\nhttps://github.com/kigster/git_scripts/blob/master/bin/git-sync-local-tags\nhttps://gist.github.com/345031\n\nThoughts?\n"},{"id":"163225","messageId":"4D7A363F.7090206@xiplink.com","threadId":"26704","inReplyTo":"4D790618.9000302@gmail.com","subject":"Re: idea: pruning stale tags","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2011-03-11T14:48:31Z","receivedAt":"2011-03-11T14:48:31Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"On 11-03-10 12:10 PM, Adam Monsen wrote:\n> My idea is to add functionality to git-remote to prune stale tags\n> (those which no longer exist on the remote). Add a new ui:\n> \n> git remote prune --tags [-n | --dry-run] <name> [<remote>]\n> \n> I think it is not possible to know which remote tags originated\n> from, yes? That's why I suggested adding the [<remote>] parameter;\n> one would be required to specify the remote to sync with if more\n> than one remote is configured.\n\nI agree with this idea, but in the context of Johan's proposed overhaul of\nref namespaces:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/165799/focus=165885\n\n\t\tM.\n"}]}