Hello,
What is the best approach to get git hash from a conan package ?
My current approach is to generate the hash myself in a file and export it with the recipe.
Is there a way maybe to extend conaninfo.txt ? (this is useful to check the git hash in artifactory)
Thanks,
Walid
Have you used the scm feature? With auto revision it hardcodes the git hash into the recipe on export. So you can, for example, use conan get to get it I guess.
@Minimonium yes I did, but no luck, here is what my recipe looks like
class MyPackageConan():
scm = {
'type': 'git',
'url': 'https://bitbucket.org/xxx/yyy.git',
'revision': 'auto'
}
....
ohh wait! that actually work, and it edit my conanfile.py!
Thanks
@boussaffawalid gald you found the solution and thanks @Minimonium for the support! I am closing the issue as resolved. Please feel free to open other issues for more questions or feedback 馃槃
Most helpful comment
Have you used the
scmfeature? Withautorevision it hardcodes the git hash into the recipe on export. So you can, for example, useconan getto get it I guess.