ARMmbed / yotta

DEPRECATED: yotta build; better software
Apache License 2.0
164 stars 64 forks source link

yotta version - error if a tag already exists, but creates the version commit #722

Open 0xc0170 opened 8 years ago

0xc0170 commented 8 years ago

I am running older yotta (0.12.2):

..\mbed-drivers (master)
λ yt version patch
info: @0.12.2
error: command failed: fatal: tag 'v0.12.2' already exists

C:\Code\git_repo\github\yotta_thing\mbed-drivers (master)
λ git logg -4
* f0ff915 - (HEAD, master) version v0.12.2 (68 seconds ago) <Martin Kojtal>

git reflog shows f0ff915 HEAD@{0}: commit: version v0.12.2, which should not happen. As 0.12.2 was already as a tag, I just realized the commit was missing there.. This should not happen (a person pushed a tag v0.12.2 but not the version commit) but we can see it does :-)

autopulated commented 8 years ago

the tag is created after the commit (it has to be, because it's the commit that's tagged!), but we could check for the existence of the tag first.

In this case was the module.json already set to the correct version, presumably not? So there was also some sort of preceding error which meant the module.json was at 0.12.1, but there was an existing tag for 0.12.2?

0xc0170 commented 8 years ago

the tag is created after the commit (it has to be, because it's the commit that's tagged!), but we could check for the existence of the tag first.

Exactly what I am proposing here. Otherwise a user needs to manually revert the last commit.

In this case was the module.json already set to the correct version, presumably not? So there was also some sort of preceding error which meant the module.json was at 0.12.1, but there was an existing tag for 0.12.2?

This was a user error, the tag was pushed upstream, but not the commit.