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

gitstatus: fix zsh integration #96136

Merged
merged 1 commit into from Sep 24, 2020
Merged

Conversation

bdesham
Copy link
Contributor

@bdesham bdesham commented Aug 24, 2020

Motivation for this change

At some point the upstream changed and gitstatus.prompt.zsh stopped working. The issue was that this file expects to be able to run the "install" script in the same directory.

  • Install the "install" script and "build.info" file that gitstatus.prompt.zsh expects to be able to find when it runs.
  • Patch the install script so that it defaults to not automatically installing gitstatus. This can still be overridden by setting GITSTATUS_AUTO_INSTALL=1, although I'm not sure why anyone would do this if they've already installed gitstatus with Nix.
  • Add an install check phase that tests the zsh integration to prevent this derivation from breaking in the same way in the future. (This also ends up testing the binary itself.)

Fixes #96135.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@bdesham bdesham requested a review from mweinelt August 24, 2020 02:44
@bdesham
Copy link
Contributor Author

bdesham commented Aug 24, 2020

cc @mmlb too—I can’t seem to add you to the reviewers list for whatever reason.

@bdesham
Copy link
Contributor Author

bdesham commented Aug 24, 2020

@GrahamcOfBorg build gitAndTools.gitstatus

At some point the upstream changed and gitstatus.prompt.zsh stopped
working. The issue was that this file expects to be able to run the
"install" script in the same directory.

- Install the "install" script and "build.info" file that
  gitstatus.prompt.zsh expects to be able to find when it runs.
- Patch the install script so that it defaults to not automatically
  installing gitstatus. This can still be overridden by setting
  GITSTATUS_AUTO_INSTALL=1, although I'm not sure why anyone would do
  this if they've already installed gitstatus with Nix.
- Add an install check phase that tests the zsh integration to prevent
  this derivation from breaking in the same way in the future. (This
  also ends up testing the binary itself.)

Fixes NixOS#96135.
@bdesham
Copy link
Contributor Author

bdesham commented Aug 24, 2020

@GrahamcOfBorg build gitAndTools.gitstatus

@ryneeverett
Copy link
Contributor

Tested on NixOS and this indeed fixes the zsh integration.

Copy link
Member

@mweinelt mweinelt left a comment

Choose a reason for hiding this comment

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

Sorry, I don't feel well equipped to review this change. It does not seem to cause a regression for me though.

@mweinelt
Copy link
Member

cc @mmlb too—I can’t seem to add you to the reviewers list for whatever reason.

Can only add org members afair.

@mmlb
Copy link
Contributor

mmlb commented Sep 23, 2020

Yep, I'm not part of the org (not sure how to get into it actually...).

@bdesham I don't use the zsh integration so am not really set up to test this. The diff looks good to me, the test makes sense too. That along with @ryneeverett's input I'd give this a :shipit:.

@mweinelt can you hit the merge button?

@mweinelt mweinelt merged commit 2be541f into NixOS:master Sep 24, 2020
@bdesham bdesham deleted the fix-gitstatus-on-zsh branch September 28, 2020 13:31
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.

gitstatus zsh integration is broken
4 participants