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

parameterize pre-commit hook by branch instead of using the literal "master" #7215

Closed
cosmicexplorer opened this issue Feb 5, 2019 · 1 comment

Comments

@cosmicexplorer
Copy link
Contributor

See #7214 (comment). It might end up with cleaner and more readable code if we settle on using a variable like BASE_BRANCH instead of typing out master literally each time. e.g.:

# The branch to calculate changed targets and files against.
BASE_BRANCH="${BASE_BRANCH:-master}"
# Test if this git repo contains the specified base branch. When travis builds a tag, it does so in
# a shallow clone without master fetched, so we currently can't calculate changes against it.
if git rev-parse --verify "$BASE_BRANCH" &>/dev/null; then echo "* Checking imports" && ./build-support/bin/isort.sh || \
  # ...
@Eric-Arellano
Copy link
Contributor

We use the value git_merge_base today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants