1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Rebase the pull request in a worktree

A pull request based on an old commit may rewind too many files,
even if unnecessary.  As rewinding some files, e.g., common header
files, configure.ac, will result in full-rebuild, rebase in a
separate directory to get rid of such rewind.
This commit is contained in:
Nobuyoshi Nakada 2019-04-25 15:03:54 +09:00
parent d0ba4abf1a
commit 09ce223b0b
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -170,10 +170,12 @@ fetch-github:
.PHONY: merge-github .PHONY: merge-github
merge-github: fetch-github merge-github: fetch-github
$(Q) $(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H)) $(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H))
git -C "$(srcdir)" checkout "gh-$(PR)" $(eval GITHUB_MERGE_BRANCH := $(shell git -C "$(srcdir)" symbolic-ref --short HEAD))
git -C "$(srcdir)" rebase - $(eval GITHUB_MERGE_WORKTREE := $(shell mktemp -d gh-$(PR)-XXXXXX))
git -C "$(srcdir)" checkout - git -C "$(srcdir)" worktree add $(GITHUB_MERGE_WORKTREE) "gh-$(PR)"
git -C "$(GITHUB_MERGE_WORKTREE)" rebase $(GITHUB_MERGE_BRANCH)
git -C "$(srcdir)" worktree remove "$(GITHUB_MERGE_WORKTREE)"
git -C "$(srcdir)" merge --ff-only "gh-$(PR)" git -C "$(srcdir)" merge --ff-only "gh-$(PR)"
git -C "$(srcdir)" branch -D "gh-$(PR)" git -C "$(srcdir)" branch -D "gh-$(PR)"
git -C "$(srcdir)" filter-branch -f \ git -C "$(srcdir)" filter-branch -f \