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

Provide a default branch for {push_files} #785

Open
mrexox opened this issue Jul 25, 2024 · 1 comment
Open

Provide a default branch for {push_files} #785

mrexox opened this issue Jul 25, 2024 · 1 comment
Labels
feature request A new lefthook feature description

Comments

@mrexox
Copy link
Member

mrexox commented Jul 25, 2024

⚡ Summary

base_branch: develop

pre-push:
  commands:
    lint:
      run: yarn lint {push_files}

Value

  1. Default branch is develop
  2. You create a new branch from develop
  3. You try to push and {push_files} contains files not agains the develop, but against main

This is confusing. This should be controlled by some setting in lefthook, since it's impossible to control the other way.

Behavior and configuration changes

@mrexox mrexox added the feature request A new lefthook feature description label Jul 25, 2024
@mrexox
Copy link
Member Author

mrexox commented Jul 25, 2024

For now you can use a workaround:

pre-push:
  only:
    - run: git remote set-head origin develop
  commands:
    ...

This will set your origin/HEAD pointing to develop branch before the {push_files} get queried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new lefthook feature description
Projects
None yet
Development

No branches or pull requests

1 participant