Skip to content
New issue

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

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

Already on GitHub? # to your account

Support using full hexsha as default gitRevision value #2529

Closed
chenxinyanc opened this issue Mar 20, 2024 · 1 comment
Closed

Support using full hexsha as default gitRevision value #2529

chenxinyanc opened this issue Mar 20, 2024 · 1 comment

Comments

@chenxinyanc
Copy link

Search Terms

full gitRevision

Problem

I want to set up git links to our git repo hosted on Azure DevOps (VSTS) with the following sourceLinkTemplate:

https://dev.azure.com/<org-name>/<project-name>/_git/<repo-name>?path={path}&version=GC{gitRevision}&line={line}

However, the generated link is invalid because {gitRevision} is replaced by the prefix of hexsha (e.g. 30e614c) instead of the full hexsha (e.g. 30e614cd9e7b5a154afa6a78f2e54f16550bfb4f).

It turns out that the gitRevision preset is using the short hexsha.

gitRevision ||= git(
"-C",
path,
"rev-parse",
"--short",
"HEAD",
).stdout.trim();

Is it possible to let us specify to use full hexsha in this case?

Suggested Solution

  • provide an option to use full hexsha as default gitRevision,
  • or change the default behavior of gitRevision to use full hexsha, but to allow us specify whether to use full hexsha value or only the prefix of it in sourceLinkTemplate, e.g., {gitRevision:short}.
@chenxinyanc chenxinyanc added the enhancement Improved functionality label Mar 20, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 20, 2024

It seems reasonable to just switch to using the long version everywhere to me

@Gerrit0 Gerrit0 removed the enhancement Improved functionality label Feb 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants