cksource / mrgit

A tool for managing projects build using multiple repositories.
51 stars 9 forks source link

Support for tags #148

Closed pomek closed 1 year ago

pomek commented 1 year ago

🎯 Goals

📗 Story

💡 Hints

przemyslaw-zan commented 1 year ago

Branch.

Support for using tags while cloning the repository is almost complete. For whatever reason, calling:

LATEST=$( git describe --abbrev=0 --tags ) && git checkout --quiet $LATEST

Works fine locally, but when trying to do it via script, it throws an error:

'LATEST' is not recognized as an internal or external command, operable program or batch file.

After I fix this, I will also have to implement this functionality for updating the repository, not just cloning it.

Question: Is it okay for the checked out tag to be in a detached head state? [Edit] It is ok.

przemyslaw-zan commented 1 year ago

Separate syntax for tags and branches could be benefitial for clarity while defining configuration in the mrgit.json file.

However, while I can ensure that anything following @ is a tag by using the tags/ prefix while checking out, there is no way that I found to ensure that # is always followed by a branch. This means, that #v30.0.0 is technically a valid syntax, even though it should not be.

pomek commented 1 year ago

That makes sense. We could detect if a tag is specified with the branch symbol, but I guess it is not worth it. So, when passing both: #v35.0.0 and @35.0.0 as a suffix, the application should accept them. When passing @latest, it tries to check out the latest tag. But passing #latest is about checking out a branch.

przemyslaw-zan commented 1 year ago

Should we assume that tags should always contain semantic version number with possibility of additional characters, (eg. @v35.0.0) or should we allow any tag name? (eg. @tagname)?

@latest is a separate case, so I'm assking about other cases.