git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [feature request] 2) Remove many tags at once and 1) Prune tags on old-branch-before-rebase

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 7, 2013, 23:33 UTC
Message-ID
<7v38w6lr8n.fsf@alter.siamese.dyndns.org>
In-Reply-To
<51390E43.60704@giref.ulaval.ca>
Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:
Show 7 quoted lines
> 1) git tag --delete-tags-to-danglings-and-unnamed-banches
>
> This would be able to remove all tags that refers to commits which are
> on branches that are no more referenced by any branch name.  This is
> happening when you tag something, then "git rebase".  Your tag will
> still be there on the old-and-before-rebase branch and won't be
> "pruned" by any git command... (that I know of...)
Not interesting for at least two reasons.

Why are "tags" any special? "git branch --delete-merged" may also be of interest, and for that matter "git update-ref -d" to deal with any ref in general would be equally valid if such an option were a good idea.

What you want is a way to compute, given a set of tags (or refs in general) and a set of branches (or another set of refs in general), find the ones in the former that none of the latter can reach. With that, you can drive "git tag -d $(that way)".

In other words, the feature does not belong to "git tag" command.
> 2) git tag -d "TOKEN*"
Again, not interesting.  You already have:
    git for-each-ref --format='%(refname:short)' refs/tags/TOKEN\* |
    xargs -r git tag -d
Previous: Eric ChamberlandNext: Eric Chamberland
Message 2 of 3 in “[feature request] 2) Remove many tags at once and 1) Prune tags on old-branch-before-rebase”
  1. Eric ChamberlandMar 7, 2013
  2. Junio C HamanoMar 7, 2013
  3. Eric ChamberlandMar 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.