The sound distributed version control system

#696 [CONSISTENCY] a ghost tag

Opened by tankf33der on July 13, 2022
tankf33der on July 13, 2022

I can operate with a tag after deletion, this is wrong.

$ pijul init p1
$ cd p1
$ rm .ignore
$ touch a
$ pijul add a
$ pijul rec -am"."
Hash: HNOFACNPYP7PVEJZ5VWHB2BULDLLJXIMY7YTSY6ENYC3PYSLEB7QC
$ pijul tag create -m"."
6QENQVM64GNHFUXCBTZ7XDAORXDGWG52PFGU3PJH5TP7TDWH6WKAC
$ pijul tag delete 6Q
Deleted tag 6QENQVM64GNHFUXCBTZ7XDAORXDGWG52PFGU3PJH5TP7TDWH6WKAC
$ echo "a" >> a
$ pijul diff --short
M a
$ cksum a
2418082923 2 a
$ pijul tag reset 6Q
Reset to tag 6QENQVM64GNHFUXCBTZ7XDAORXDGWG52PFGU3PJH5TP7TDWH6WKAC
$ cksum a
4294967295 0 a
$
spacefrogg on July 18, 2022

A deleted tag is like an orphaned commit in git, not like a deleted tag in git.

I think, pijul is rather missing the same tooling as for changes that allow you to attach a tag, known by its hash, to another channel. Then, it immediately makes sense again to interact with a ‘deleted tag’. Additionally, just because you deleted the tag in channel ‘main’ doesn’t mean it doesn’t exist in some other channel or would exist again after the next pull from a remote. In contrast to git, tags are attached to channels and can be pushed/pulled. So, while not obvious, it makes perfect sense for a ‘deleted tag’ to still hang around in the repository.