Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andry81 opened this issue Jun 17, 2023 · 5 comments
Open

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

andry81 opened this issue Jun 17, 2023 · 5 comments

Comments

@andry81
Copy link

andry81 commented Jun 17, 2023

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: #243

@traversaro
Copy link

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

@andry81
Copy link
Author

andry81 commented Jun 17, 2023

There is another issue with the picture of the commits graph: NirmalScaria/le-git-graph#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.

@christophebedard
Copy link
Contributor

christophebedard commented Jun 17, 2023

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?

@andry81
Copy link
Author

andry81 commented Jun 19, 2023

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.

@christophebedard
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants