You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better support for diff calculation for rebase workflow #2424
In a monorepo workflow where user workflow includes rebase on top of default branch to get latest changes, diff calculation for pre-push hooks can often result in files that was updated in default branch instead of user feature branch. This led to a lot of linters being triggered on files irrelevant to users.
Sample workflow:
git checkout master
git fetch origin
git reset --hard origin/master
git checkout -b user1/feature-a
<coding>
git add a
git commit -a -m "add ft a"
git push
<more coding>
git add a
git commit -a -m "adjust ft a"
git fetch origin
git rebase origin/master
git push --force
On the second git-push, we expect that only pre-push hooks which are relevant to file a, which the user is responsible for, are executed. However, the effective diff range was origin/master@{1}..origin/master + origin/master..HEAD which can include thousands of files in a fast moving monorepo.
There should be a config that let user ignore the changes in default branch entirely.
Activity
asottile commentedon Jun 16, 2022
dupe #860
CharlesB2 commentedon Apr 11, 2024
Update hook_impl.py