* Zombie tag
@ 2016-01-21 8:17 stefan.naewe
2016-01-21 14:48 ` stefan.naewe
0 siblings, 1 reply; 2+ messages in thread
From: stefan.naewe @ 2016-01-21 8:17 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]
I'm having trouble to get rid of a deleted tag.
Here's what I did:
- push master branch from a non-bare repo (R1) into a bare repo (B1)
- push a tag (tag-a) from R1 into the same B1
- force-push master from another non-bare repo (R2) into B1
- do 'git push B1 :tag-a' from R2 to delete the tag
Now, in B1, 'git fsck' shows a dangling tag that can be identified
as 'tag-a' from above. There's obviously no reflog in B1.
I don't know how to get rid of that tag.
A cleaned-up 'script' session of the above is attached.
The problem initially occurred on Windows with git 2.7.0 but could
be reproduced on a Linux machine with git 2.7.0.
What's going on here ?
Thanks,
Stefan
--
----------------------------------------------------------------
/dev/random says: Polls show that 9 out of 6 schizophrenics agree.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')"
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9 9666 829B 49C5 9221 27AF
[-- Attachment #2: zombie-tag.typescript --]
[-- Type: text/plain, Size: 4733 bytes --]
~/tmp/zombie-tag ~
$ git init repo1
Initialized empty Git repository in /home/naewe_s/tmp/zombie-tag/repo1/.git/
$ git init repo2
Initialized empty Git repository in /home/naewe_s/tmp/zombie-tag/repo2/.git/
$ git init --bare bare1.git
Initialized empty Git repository in /home/naewe_s/tmp/zombie-tag/bare1.git/
$ cd repo1
$ echo A > A ; git add A ; git commit -m"add A"
[master (root-commit) d9e5baf] add A
1 file changed, 1 insertion(+)
create mode 100644 A
$ echo B > B ; git add B ; git commit -m"add B"
[master 3810738] add B
1 file changed, 1 insertion(+)
create mode 100644 B
$ git tag -m"initial" initial\r$ git push ../bare1.git/ master initial
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing 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.
Writing 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.
Total 7 (delta 1), reused 0 (delta 0)
To ../bare1.git
* [new branch] master -> master
* [new tag] initial -> initial
$ cd ../repo2
$ for n in 1 2; do echo $n > $n ; git add $n; git commit -m"add $n"; done
[master (root-commit) e2ebcc4] add 1
1 file changed, 1 insertion(+)
create mode 100644 1
[master f8d1071] add 2
1 file changed, 1 insertion(+)
create mode 100644 2
$ git push -f ../bare1.git/ master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 33% (1/3) \rCompressing objects: 66% (2/3) \rCompressing objects: 100% (3/3) \rCompressing objects: 100% (3/3), done.
Writing 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.
Total 6 (delta 1), reused 0 (delta 0)
To ../bare1.git
+ 3810738...f8d1071 master -> master (forced update)
$ git push ../bare1.git/ :initial
To ../bare1.git
- [deleted] initial
$ cd ../bare1.git/
$ git log --oneline
f8d1071 add 2
e2ebcc4 add 1
\r$ git for-each-ref
f8d10716fc887da36df53f58660bfaa77ff5a411 commit refs/heads/master
$ git fsck
Checking 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.
dangling tag 88a23db671d20eb6a4384207bf24b8e0c667a288
dangling commit 381073887a81082128b84945fe07c96c400e86da
$ git show 88a23db671d20e
tag initial
Tagger: Stefan Naewe <stefan.naewe@xyz.com>
Date: Thu Jan 21 08:51:05 2016 +0100
initial
commit d9e5baf52f472c49fd4fd1faeb6f0752dfe3980b
Author: Stefan Naewe <stefan.naewe@xyz.com>
Date: Thu Jan 21 08:50:41 2016 +0100
add A
diff --git a/A b/A
new file mode 100644
index 0000000..f70f10e
--- /dev/null
+++ b/A
@@ -0,0 +1 @@
+A
\r$ git reflog
$ git gc
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 33% (1/3) \rCompressing objects: 66% (2/3) \rCompressing objects: 100% (3/3) \rCompressing objects: 100% (3/3), done.
Writing 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.
Total 6 (delta 1), reused 0 (delta 0)
$ git fsck
Checking 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.
Checking objects: 0% (0/6) \rChecking objects: 100% (6/6) \rChecking objects: 100% (6/6), done.
dangling tag 88a23db671d20eb6a4384207bf24b8e0c667a288
dangling commit 381073887a81082128b84945fe07c96c400e86da
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: Zombie tag
2016-01-21 8:17 Zombie tag stefan.naewe
@ 2016-01-21 14:48 ` stefan.naewe
0 siblings, 0 replies; 2+ messages in thread
From: stefan.naewe @ 2016-01-21 14:48 UTC (permalink / raw)
To: git
Am 21.01.2016 um 09:17 schrieb stefan.naewe@atlas-elektronik.com:
> I'm having trouble to get rid of a deleted tag.
> Here's what I did:
>
> - push master branch from a non-bare repo (R1) into a bare repo (B1)
> - push a tag (tag-a) from R1 into the same B1
> - force-push master from another non-bare repo (R2) into B1
> - do 'git push B1 :tag-a' from R2 to delete the tag
> Now, in B1, 'git fsck' shows a dangling tag that can be identified
> as 'tag-a' from above. There's obviously no reflog in B1.
> I don't know how to get rid of that tag.
Just do 'git gc --prune=all' or 'git prune', stupid!
> A cleaned-up 'script' session of the above is attached.
>
> The problem initially occurred on Windows with git 2.7.0 but could
> be reproduced on a Linux machine with git 2.7.0.
>
> What's going on here ?
I guess one never stops learning when using git...
Stefan
--
----------------------------------------------------------------
/dev/random says: Socialism is the equal distribution of poverty.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')"
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9 9666 829B 49C5 9221 27AF
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-21 14:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 8:17 Zombie tag stefan.naewe
2016-01-21 14:48 ` stefan.naewe
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).