From e9da3e4f69c320ad703a01d206ad97ff6991ec28 Mon Sep 17 00:00:00 2001 From: toofar Date: Thu, 8 Dec 2022 08:43:21 +1300 Subject: add -X theirs to rebase onto formatted master I'm seeing conflicts when trying to apply later commits that are complaining about formatting changes made in earlier commits. In particular the changes that are left in the working tree during a rebase that are getting picked up by the "fix lint" commits. I'm a little worried about this. For resolving those particular conflicts -X theirs is the right thing to do, just take the new commit, it already essentially replaces prior ones. But in cases where there is a real conflict with master might we be obscuring that? Should be able to test that. TODO: * look more into the cause of the "fix lint" commits, maybe even try changing that to `reset HEAD` since those are just lint changes * test if -X theirs will obscure real conflicts, look into some PRs to see if it is doing weird stuff (I checked 7405 and 7312 already and they look good!) --- scripts/check_mergability.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/check_mergability.sh b/scripts/check_mergability.sh index 1e8affc89..a18ad8098 100755 --- a/scripts/check_mergability.sh +++ b/scripts/check_mergability.sh @@ -285,8 +285,13 @@ EOF # not sure why I had to do the extra git commit in there, there are some # changes left in the working directory sometimes? TODO: change to a # commit --amend -C HEAD after confirming overall results + # Need to revisit some assumptions about the smudge filter, does it always + # leave changes in the working tree? # TODO: look for conflict markers before merging - git rebase -q -X renormalize --exec 'git commit -qam "fix lint" || true' tmp-master-rewrite-pr/$number + # `theirs` here applies to the incoming commits, so the branch being + # rebased. Without that changes made by the smudge filter seem to conflict + # with later changes by the smudge filter. See #7312 for example + git rebase -q -X theirs -X renormalize --exec 'git commit -qam "fix lint" || true' tmp-master-rewrite-pr/$number exit_code="$?" [ $exit_code -eq 0 ] || git rebase --abort git branch -D tmp-master-rewrite-pr/$number -- cgit v1.2.3-54-g00ecf