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

Graceful fallback when a git executable is not present #8476

Open
mikepurvis opened this issue Jun 8, 2023 · 0 comments
Open

Graceful fallback when a git executable is not present #8476

mikepurvis opened this issue Jun 8, 2023 · 0 comments
Labels

Comments

@mikepurvis
Copy link

Describe the bug

In CI setups, it's common to be in a very a minimal environment that's missing a git executable, but also working in a git clone that was volumed-in from a sidecar container. You can end up with Nix seeing the .git directory and then throwing this:

error: getting the HEAD of the Git tree '/home/jenkins/agent/workspace/<job>' failed with exit code 1:
       error: executing 'git': No such file or directory

However, if .git is deleted, then Nix happily treats it as a plain directory flake. It would be great if this were the automatic behaviour, so:

  • See .git, try to invoke git executable.
  • If missing, emit a warning and fall back to treating the directory as if there was no .git present.
@mikepurvis mikepurvis added the bug label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant