{"thread":{"id":"41233","subject":"Zombie tag","startedAt":"2016-01-21T08:17:28Z","lastAt":"2016-01-21T14:48:50Z","messageCount":2,"participants":["stefan.naewe@atlas-elektronik.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"276489","messageId":"56A09418.1070201@atlas-elektronik.com","threadId":"41233","inReplyTo":null,"subject":"Zombie tag","fromName":"","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2016-01-21T08:17:28Z","receivedAt":"2016-01-21T08:17:28Z","isPatch":false,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"I'm having trouble to get rid of a deleted tag.\nHere's what I did:\n\n- push master branch from a non-bare repo (R1) into a bare repo (B1)\n- push a tag (tag-a) from R1 into the same B1\n- force-push master from another non-bare repo (R2) into B1\n- do 'git push B1 :tag-a' from R2 to delete the tag\nNow, in B1, 'git fsck' shows a dangling tag that can be identified\nas 'tag-a' from above. There's obviously no reflog in B1.\nI don't know how to get rid of that tag.\n\nA cleaned-up 'script' session of the above is attached.\n\nThe problem initially occurred on Windows with git 2.7.0 but could\nbe reproduced on a Linux machine with git 2.7.0.\n\nWhat's going on here ?\n\nThanks,\n  Stefan\n-- \n----------------------------------------------------------------\n/dev/random says: Polls show that 9 out of 6 schizophrenics agree.\npython -c \"print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')\" \nGPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF\n\n\n~/tmp/zombie-tag ~\n$ git init repo1\nInitialized empty Git repository in /home/naewe_s/tmp/zombie-tag/repo1/.git/\n$ git init repo2\nInitialized empty Git repository in /home/naewe_s/tmp/zombie-tag/repo2/.git/\n$ git init --bare bare1.git\nInitialized empty Git repository in /home/naewe_s/tmp/zombie-tag/bare1.git/\n$ cd repo1\n$ echo A > A ; git add A ; git commit -m\"add A\"\n[master (root-commit) d9e5baf] add A\n 1 file changed, 1 insertion(+)\n create mode 100644 A\n$ echo B > B ; git add B ; git commit -m\"add B\"\n[master 3810738] add B\n 1 file changed, 1 insertion(+)\n create mode 100644 B\n$ git tag -m\"initial\" initial\r$ git push ../bare1.git/ master initial\nCounting objects: 7, done.\nDelta compression using up to 2 threads.\nCompressing objects:  25% (1/4)   \rCompressing objects:  50% (2/4)   \rCompressing objects:  75% (3/4)   \rCompressing objects: 100% (4/4)   \rCompressing objects: 100% (4/4), done.\nWriting objects:  14% (1/7)   \rWriting objects:  28% (2/7)   \rWriting objects:  42% (3/7)   \rWriting objects:  57% (4/7)   \rWriting objects:  71% (5/7)   \rWriting objects:  85% (6/7)   \rWriting objects: 100% (7/7)   \rWriting objects: 100% (7/7), 548 bytes | 0 bytes/s, done.\nTotal 7 (delta 1), reused 0 (delta 0)\nTo ../bare1.git\n * [new branch]      master -> master\n * [new tag]         initial -> initial\n$ cd ../repo2\n$ for n in 1 2; do echo $n > $n ; git add $n; git commit -m\"add $n\"; done\n[master (root-commit) e2ebcc4] add 1\n 1 file changed, 1 insertion(+)\n create mode 100644 1\n[master f8d1071] add 2\n 1 file changed, 1 insertion(+)\n create mode 100644 2\n$ git push -f ../bare1.git/ master\nCounting objects: 6, done.\nDelta compression using up to 2 threads.\nCompressing objects:  33% (1/3)   \rCompressing objects:  66% (2/3)   \rCompressing objects: 100% (3/3)   \rCompressing objects: 100% (3/3), done.\nWriting objects:  16% (1/6)   \rWriting objects:  33% (2/6)   \rWriting objects:  50% (3/6)   \rWriting objects:  66% (4/6)   \rWriting objects:  83% (5/6)   \rWriting objects: 100% (6/6)   \rWriting objects: 100% (6/6), 384 bytes | 0 bytes/s, done.\nTotal 6 (delta 1), reused 0 (delta 0)\nTo ../bare1.git\n + 3810738...f8d1071 master -> master (forced update)\n$ git push ../bare1.git/ :initial\nTo ../bare1.git\n - [deleted]         initial\n$ cd ../bare1.git/\n$ git log --oneline\nf8d1071 add 2\ne2ebcc4 add 1\n\r$ git for-each-ref\nf8d10716fc887da36df53f58660bfaa77ff5a411 commit\trefs/heads/master\n$ git fsck\nChecking object directories:   5% (13/256)   \rChecking object directories:  11% (30/256)   \rChecking object directories:  13% (35/256)   \rChecking object directories:  22% (57/256)   \rChecking object directories:  53% (137/256)   \rChecking object directories:  81% (209/256)   \rChecking object directories:  83% (213/256)   \rChecking object directories:  85% (218/256)   \rChecking object directories:  87% (223/256)   \rChecking object directories:  88% (227/256)   \rChecking object directories:  96% (246/256)   \rChecking object directories:  97% (249/256)   \rChecking object directories: 100% (256/256)   \rChecking object directories: 100% (256/256), done.\ndangling tag 88a23db671d20eb6a4384207bf24b8e0c667a288\ndangling commit 381073887a81082128b84945fe07c96c400e86da\n$ git show  88a23db671d20e\ntag initial\nTagger: Stefan Naewe <stefan.naewe@xyz.com>\nDate:   Thu Jan 21 08:51:05 2016 +0100\n\ninitial\n\ncommit d9e5baf52f472c49fd4fd1faeb6f0752dfe3980b\nAuthor: Stefan Naewe <stefan.naewe@xyz.com>\nDate:   Thu Jan 21 08:50:41 2016 +0100\n\n    add A\n\ndiff --git a/A b/A\nnew file mode 100644\nindex 0000000..f70f10e\n--- /dev/null\n+++ b/A\n@@ -0,0 +1 @@\n+A\n\r$ git reflog\n\n$ git gc\nCounting objects: 6, done.\nDelta compression using up to 2 threads.\nCompressing objects:  33% (1/3)   \rCompressing objects:  66% (2/3)   \rCompressing objects: 100% (3/3)   \rCompressing objects: 100% (3/3), done.\nWriting objects:  16% (1/6)   \rWriting objects:  33% (2/6)   \rWriting objects:  50% (3/6)   \rWriting objects:  66% (4/6)   \rWriting objects:  83% (5/6)   \rWriting objects: 100% (6/6)   \rWriting objects: 100% (6/6), done.\nTotal 6 (delta 1), reused 0 (delta 0)\n\n$ git fsck\nChecking object directories:  11% (30/256)   \rChecking object directories:  13% (35/256)   \rChecking object directories:  22% (57/256)   \rChecking object directories:  53% (137/256)   \rChecking object directories:  85% (218/256)   \rChecking object directories:  96% (246/256)   \rChecking object directories: 100% (256/256)   \rChecking object directories: 100% (256/256), done.\nChecking objects:   0% (0/6)   \rChecking objects: 100% (6/6)   \rChecking objects: 100% (6/6), done.\ndangling tag 88a23db671d20eb6a4384207bf24b8e0c667a288\ndangling commit 381073887a81082128b84945fe07c96c400e86da\n"},{"id":"276499","messageId":"56A0EFD2.40204@atlas-elektronik.com","threadId":"41233","inReplyTo":"56A09418.1070201@atlas-elektronik.com","subject":"Re: Zombie tag","fromName":"","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2016-01-21T14:48:50Z","receivedAt":"2016-01-21T14:48:50Z","isPatch":false,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"Am 21.01.2016 um 09:17 schrieb stefan.naewe@atlas-elektronik.com:\n> I'm having trouble to get rid of a deleted tag.\n> Here's what I did:\n> \n> - push master branch from a non-bare repo (R1) into a bare repo (B1)\n> - push a tag (tag-a) from R1 into the same B1\n> - force-push master from another non-bare repo (R2) into B1\n> - do 'git push B1 :tag-a' from R2 to delete the tag\n> Now, in B1, 'git fsck' shows a dangling tag that can be identified\n> as 'tag-a' from above. There's obviously no reflog in B1.\n> I don't know how to get rid of that tag.\n\nJust do 'git gc --prune=all' or 'git prune', stupid!\n\n> A cleaned-up 'script' session of the above is attached.\n> \n> The problem initially occurred on Windows with git 2.7.0 but could\n> be reproduced on a Linux machine with git 2.7.0.\n> \n> What's going on here ?\n\nI guess one never stops learning when using git...\n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: Socialism is the equal distribution of poverty.\npython -c \"print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')\" \nGPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF\n"}]}