vcstool icon indicating copy to clipboard operation
vcstool copied to clipboard

[Feature Request] version by author or commit date-time

Open andry81 opened this issue 2 years ago • 5 comments
trafficstars

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

andry81 avatar Jun 17 '23 00:06 andry81

Can you make an example (on a real repo) of how you checkout a commit given this style of version? Thanks!

traversaro avatar Jun 17 '23 09:06 traversaro

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.

andry81 avatar Jun 17 '23 11:06 andry81

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?

christophebedard avatar Jun 17 '23 16:06 christophebedard

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.

andry81 avatar Jun 19 '23 07:06 andry81

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.

christophebedard avatar Jul 17 '23 15:07 christophebedard