ruby-changes:55517
From: Nobuyoshi <ko1@a...>
Date: Thu, 25 Apr 2019 15:12:10 +0900 (JST)
Subject: [ruby-changes:55517] Nobuyoshi Nakada:09ce223b0b (trunk): Rebase the pull request in a worktree
Nobuyoshi Nakada 2019-04-25 15:03:54 +0900 (Thu, 25 Apr 2019) New Revision: 09ce223b0b https://git.ruby-lang.org/ruby.git/commit/?id=3D09ce223b0b Log: 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. Modified files: defs/gmake.mk= From 09ce223b0b297359fd7f9a5d629a70be32157302 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 25 Apr 2019 15:03:54 +0900 Subject: 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. diff --git a/defs/gmake.mk b/defs/gmake.mk index 73ae01b..4e0e233 100644 --- a/defs/gmake.mk +++ b/defs/gmake.mk @@ -170,10 +170,12 @@ fetch-github: https://github.com/ruby/ruby/blob/trunk/#L170 .PHONY: merge-github merge-github: fetch-github - $(Q) $(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H)) - git -C "$(srcdir)" checkout "gh-$(PR)" - git -C "$(srcdir)" rebase - - git -C "$(srcdir)" checkout - + $(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H)) + $(eval GITHUB_MERGE_BRANCH := $(shell git -C "$(srcdir)" symbolic-ref --short HEAD)) + $(eval GITHUB_MERGE_WORKTREE := $(shell mktemp -d gh-$(PR)-XXXXXX)) + 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)" branch -D "gh-$(PR)" git -C "$(srcdir)" filter-branch -f \ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/