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
Add on_git_branch command to detect whether a specific git branch is checked out #702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
Can you also document the function in man/direnv-stdlib.1.md ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed comments + added entry to man/direnv-stdlib.1.md
, PTAL!
It looks like the branch is ready? |
Yup, I'm happy with it if you are! |
thanks! |
When working on GitHub projects, I've found it helpful to have env variables set-up when I'm inside a specific branch. For example, sometimes I want to change the merge-base my editor uses to display signifiers. I can accomplish this with the new command like so:
To detect movement between branches, the
.git/HEAD
file is watched withwatch_file
. This is only done when a branch name is specified, otherwise no calls towatch_file
are made.