conan
conan copied to clipboard
[suggestion] Allow specifying commit hash when installing config from git repository with `conan config install`
What is your suggestion?
Hello,
the project I work on keeps the conan config files in the project's git repo, with a post-checkout hook that calls conan config install to ensure that the correct config files for that specific commit are installed. We recently modularized our code a bit and moved parts of it to a different repo, and we have duplicated the conan config files there for now. To avoid issues when the config is accidentally only changed in one of the repos we'd like to move the conan config files to a dedicated repo so that they can be shared properly.
However, conan config install only allows to specify additional arguments for the git clone call, and since git clone doesn't allow to specify an individual commit we can only install from a branch or tag. This makes it inconvenient to pin the exact version of the config files in our source code repos: Whenever someone makes a change to the config files in the config repo we need to add a new tag (or branch), so that we can explicitly check out this commit when calling conan config install in our post-checkout hook.
If we were to always install the config from the main branch instead of a pinned commit there might be issues that older commits can no longer be rebuilt if we make some incompatible changes to our conan config, which also isn't ideal
It would be very helpful if conan config install were to gain a command-line flag to specify the hash of a commit in the config repo, which it will automatically switch to after cloning and then install the config from there.
Have you read the CONTRIBUTING guide?
- [X] I've read the CONTRIBUTING guide