{"thread":{"id":"33103","subject":"[feature request] 2) Remove many tags at once and 1) Prune tags on old-branch-before-rebase","startedAt":"2013-03-07T22:01:39Z","lastAt":"2013-03-08T19:37:21Z","messageCount":3,"participants":["Eric Chamberland","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"210791","messageId":"51390E43.60704@giref.ulaval.ca","threadId":"33103","inReplyTo":null,"subject":"[feature request] 2) Remove many tags at once and 1) Prune tags on old-branch-before-rebase","fromName":"Eric Chamberland","fromEmail":"eric.chamberland@giref.ulaval.ca","sentAt":"2013-03-07T22:01:39Z","receivedAt":"2013-03-07T22:01:39Z","isPatch":false,"sender":{"key":"eric.chamberland@giref.ulaval.ca","avatar":null},"body":"Hi,\n\n============================\nShort story:\n============================\nwe are now using *annotated* tags in a way that we would need to manage \n(remove) them easily. It would be usefull to have one of the folowing in \n\"git tag\":\n\n1) git tag --delete-tags-to-danglings-and-unnamed-banches\n\nThis would be able to remove all tags that refers to commits which are \non branches that are no more referenced by any branch name.  This is \nhappening when you tag something, then \"git rebase\".  Your tag will \nstill be there on the old-and-before-rebase branch and won't be \"pruned\" \nby any git command... (that I know of...)\n\nThen you will end up to delete all of them \"by hand\"...\n\nto do so you would like to have:\n\n2) git tag -d \"TOKEN*\"\n\nThis would be able to delete all tags referred by the name.\nOk ok, I can do this like this:\n\nrm .git/refs/tags/TOKEN*\n\nbut why have the git users \"play\" into the .git...?\n\n============================\n\n\n----------------------------------------\nLong story:\n----------------------------------------\n\nWe started using annotated tags to hold information about the code \n\"status\", ie the results of our regression tests are stored in annotated \ntags each time you do a \"make test\" in the distribution.  We can \nretrieve the information by \"git show\" which we aliased to parse the \noutput, extract the \".html\" that we stored in the tag message  (about \n67kb) and then display the \"make test\" results as a web page in a \nbrowser... ;-)\n\nWe also \"resume\" the information on the number of \"(P)assed\" and \n\"(F)ailed\" tests in the tag name to quickly view the overall status of \nthe code in the local clone.  For example, we end up with tags name like \nthese:\n\nSQA_ericc_ad76kj78_P_155_F_0\n\nas a result of: SQA_${USER}_${SHA}_P_${PASSED}_F_${FAILED}\n\nHowever, the number of tags increases as you do many \"make test\" to \nvalidate your developments and see the progressions you do.\n\nMoreover, when you \"git fetch\" from colleagues, you retrieve their \nannotated tags too, which is nice, since you can view the results of the \nregression tests they have done, which can contain useful information to \nshare...\n\nBUT, when your colleagues delete their old tags because they rebased, \nyou don't have the possibility to \"git fetch --prune-tags\", so you are \nleft with all those \"old\" tags hanging all around and would like to \neasily remove them...\n\nBecause you know that no more branches are associated with the tip \ncommit of all those \"old-before-rebased-branches\", you would like \nsomething like feature request #1 to automagically do the job you do by \nhand in feature request #2... ;-)\n\nOk, we shall not rebase but merge, but this is another long story... ;-)\n\nHope all this might be useful to other, so if other people start using \ntags like this, more will hope to have these features... ;-)\n----------------------------------------\n\n\nthanks,\n\nEric\n"},{"id":"210801","messageId":"7v38w6lr8n.fsf@alter.siamese.dyndns.org","threadId":"33103","inReplyTo":"51390E43.60704@giref.ulaval.ca","subject":"Re: [feature request] 2) Remove many tags at once and 1) Prune tags on old-branch-before-rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-07T23:33:44Z","receivedAt":"2013-03-07T23:33:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:\n\n> 1) git tag --delete-tags-to-danglings-and-unnamed-banches\n>\n> This would be able to remove all tags that refers to commits which are\n> on branches that are no more referenced by any branch name.  This is\n> happening when you tag something, then \"git rebase\".  Your tag will\n> still be there on the old-and-before-rebase branch and won't be\n> \"pruned\" by any git command... (that I know of...)\n\nNot interesting for at least two reasons.\n\nWhy are \"tags\" any special?  \"git branch --delete-merged\" may also\nbe of interest, and for that matter \"git update-ref -d\" to deal with\nany ref in general would be equally valid if such an option were a\ngood idea.\n\nWhat you want is a way to compute, given a set of tags (or refs in\ngeneral) and a set of branches (or another set of refs in general),\nfind the ones in the former that none of the latter can reach.  With\nthat, you can drive \"git tag -d $(that way)\".\n\nIn other words, the feature does not belong to \"git tag\" command.\n\n> 2) git tag -d \"TOKEN*\"\n\nAgain, not interesting.  You already have:\n\n    git for-each-ref --format='%(refname:short)' refs/tags/TOKEN\\* |\n    xargs -r git tag -d\n"},{"id":"210849","messageId":"513A3DF1.7020009@giref.ulaval.ca","threadId":"33103","inReplyTo":"7v38w6lr8n.fsf@alter.siamese.dyndns.org","subject":"Re: [feature request] 2) Remove many tags at once and 1) Prune tags on old-branch-before-rebase","fromName":"Eric Chamberland","fromEmail":"eric.chamberland@giref.ulaval.ca","sentAt":"2013-03-08T19:37:21Z","receivedAt":"2013-03-08T19:37:21Z","isPatch":false,"sender":{"key":"eric.chamberland@giref.ulaval.ca","avatar":null},"body":"Hi Junio,\n\nOn 03/07/2013 06:33 PM, Junio C Hamano wrote:\n> Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:\n>\n> What you want is a way to compute, given a set of tags (or refs in\n> general) and a set of branches (or another set of refs in general),\n> find the ones in the former that none of the latter can reach.  With\n> that, you can drive \"git tag -d $(that way)\".\n>\n\nYes, this is *exactly* what I want...\n\n> In other words, the feature does not belong to \"git tag\" command.\n>\n>> 2) git tag -d \"TOKEN*\"\n>\n> Again, not interesting.  You already have:\n>\n>      git for-each-ref --format='%(refname:short)' refs/tags/TOKEN\\* |\n>      xargs -r git tag -d\n>\n\nI don't agree here for one reason:\n\ngit tag -l \"TOKEN*\"\n\nalready exists and works very well...\n\nSo why is it not interesting to have:\n\ngit tag -d \"TOKEN*\"\n\n?\n\nWe can also write:\n\ngit tag -d `git tag -l \"TOKEN*\"`\n\nbut a simple addition to \"-d\" feature looks like a receivable behavior \nhere, no?\n\nThanks,\n\nEric\n"}]}