vcstool
vcstool copied to clipboard
[Feature Request] version by author or commit date-time
For example, a dependency repository can be rewritten and lose the connection by the commit hash. But basically the commit author date stays intact.
To avoid dependency breakage is useful to add a date-time version:
repositories:
_externals/lib1:
type: git
url: https://github.com/user/lib1
version: {2023-03-17T13:21:23.320813Z}
Or more detailed:
repositories:
_externals/lib1:
type: git
url: https://github.com/user/lib1
version: {author@2023-03-17T13:21:23.320813Z}
This additionally can help to fix this issue: https://github.com/dirk-thomas/vcstool/issues/243
Can you make an example (on a real repo) of how you checkout a commit given this style of version? Thanks!
There is another issue with the picture of the commits graph: https://github.com/NirmalScaria/le-git-graph/issues/44
I use tagged commits out of branch to freeze versions. The time can be taken from the commit in a branch (git log -1 --format="%ci" r204-update4~1). The rest is just usual vcs import.
This seems like a misuse of git. What happens if two commits have the same author date? Git commit hashes are supposed to be unique, but timestamps are not.
a dependency repository can be rewritten and lose the connection by the commit hash.
I use tagged commits out of branch to freeze versions.
Why not just use tags?
Git commit hashes are supposed to be unique, but timestamps are not.
Probability of the same timestamp of 2 different commits in a branch is pretty low. As I said the hash can not exist after rewrite. The author timestamp more reliable than the commit hash in such situation.
Why not just use tags?
I am.
I'm not currently a maintainer, but this feature request is very specific to your workflow. Feel free to submit a pull request and we can take a look, but again it might not necessarily be accepted given that this is such a specific feature.
Note that vcstool features should generally apply to/support all supported version control systems, if applicable.