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

nixos/version: fix case where .git is a symlink #78058

Merged
merged 1 commit into from Jan 24, 2020

Conversation

fpletz
Copy link
Member

@fpletz fpletz commented Jan 19, 2020

Motivation for this change

Before c9214c3 and 9d396d2 if .git is symlink the version would gracefully default to no git revision. With those changes, an exception is thrown instead.

This introduces a new function pathIsGitRepo that checks if commitIdFromGitRepo fails without error so we don't have to reimplement this logic again and can fail gracefully.

Things done
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@fpletz fpletz added 6.topic: nixos 0.kind: regression Something that worked before working no longer labels Jan 19, 2020
@fpletz fpletz requested a review from elseym January 19, 2020 23:50
Copy link
Member

@elseym elseym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

Before c9214c3 and
9d396d2 if .git is symlink the version
would gracefully default to no git revision. With those changes an
exception is thrown instead.

This introduces a new function `pathIsGitRepo` that checks if
`commitIdFromGitRepo` fails without error so we don't have to
reimplement this logic again and can fail gracefully.
@fpletz fpletz force-pushed the nixos/version-gitdir-symlink branch from dad866b to 46773a1 Compare January 19, 2020 23:54
@fpletz fpletz merged commit 402b97f into NixOS:master Jan 24, 2020
@fpletz fpletz deleted the nixos/version-gitdir-symlink branch January 24, 2020 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants