question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow disabling "g" prefix for commit hash in version number

See original GitHub issue

I’ve had multiple folks (including myself) be confused about the g in front of the commit sha of a version number like 16.0.40-preview+ge6c3a1f9e4.

You don’t immediately realize without knowing this convention that the g isn’t part of the sha and wonder why you can’t find the commit. Is there a reason for the prefix or could there be an option to turn it off?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
AArnottcommented, Dec 9, 2018

I think the approach to fix this should be that we remove the g whenever the version.json file has opted into semver 2 for nuget packages. Or in other words, we use the g only for nuget package versions, and only when using semver 1 rules (which is the default).

3reactions
AArnottcommented, Nov 26, 2018

It stands for git, and provides a more deterministic way to ascertain that what follows is the commit ID. I don’t remember where it came from (I didn’t invent the convention).

I’ve heard this feedback several times though, and I sympathize with the inconvenience of not being able to just double-click to select the “word” and paste it somewhere else without having to trim off the leading g.

I’m not sure anyone even likes the leading g (as folks don’t tend to reinforce behavior that they like), so while an option to remove it seems perfectly reasonable, it’s worth considering simply removing it entirely, or at least making the option default to removal.

I’m planning some breaking changes for a 3.0 version, and changing this behavior (or at least the default) would be well-placed for the 3.0 version, I think. And perhaps we can add the option in 2.3, but change its default in 3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to manage the version number in Git?
Tags in Git can be used to add a version number. git tag -a "v1.5.0-beta" -m "version ... of commit's hash. The g...
Read more >
Allow for the "-g" prefix to be part of the generated version ...
Currently this is not possible; the "commit-hash" part of the version number does not contain the -g prefix. Current behaviour:.
Read more >
Git - git-commit Documentation
Create a new commit containing the current contents of the index and the given log message describing the changes. The new commit is...
Read more >
Git - pretty-formats Documentation
The raw format shows the entire commit exactly as stored in the commit object. Notably, the hashes are displayed in full, regardless of...
Read more >
Push rules | GitLab
Require expression in commit messages: Messages must match the expression. To allow any commit message, leave empty. Uses multiline mode, which can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found