fancy-motherboard-24956
10/07/2019, 12:46 PM# Checkout your feature branch
git checkout feature_branch
# The pre-commit check can be a little annoying when doing rebases (can't pass --no-verify).
# Let's manually disable it for the time of our rebases
mv ./.git/hooks/pre-commit ./.git/hooks/pre-commit.backup
# Manually handle any (genuine) conflict pre_black
git rebase black-formatting^
# Automatically format the code in each commit of your feature branch
git rebase --interactive --exec './pants --owner-of="`git show --name-only --pretty=\"\" HEAD`" fmt-v2 && git add `git show --name-only --pretty="" HEAD` && git commit --amend --no-edit && git stash' black-formatting^
# Rebase your formatted code on top of the black commit.
# Because of the previous step, and because the black commit only formats files,
# This should not cause any conflict.
# (Caveat: if you touched the isort config or one of the tests that were formatting dependent,
# you may have a small amount of conflicts to handle)
git rebase --interactive --strategy-option=theirs --exec './pants --changed-parent="HEAD^" fmt-v2 && git add `git show --name-only --pretty="" HEAD` && git commit --amend --no-edit' black-formatting
# Handle any conflict since black (only genuine conflicts. formatting won't be part of it)
git rebase master
# Don't forget to re-enable the pre-commit hook
mv ./.git/hooks/pre-commit.backup ./.git/hooks/pre-commit
# All done. When you're ready, you may update your PR.
git push -f your_remote feature_branch
If you have any difficulty with the above steps, or are unsure about anything; feel free to DM me and I will help you through it 😄
Thanks everyone for the discussions, reviews and comments that made this possible 🙂aloof-angle-91616
10/07/2019, 5:22 PMgit fetch --tags upstream
to get the black-formatting
tag"$()"
/Users/dmcclanahan/tools/pants-v6/build-support/virtualenv: line 12: /Users/dmcclanahan/tools/pants-v6/build-support/build-support/common.sh: No such file or directory
build-support/build-support
is repeated heregit clean -xfd
i guessfancy-motherboard-24956
10/07/2019, 5:34 PM