ruby-changes:55511
From: Takashi <ko1@a...>
Date: Wed, 24 Apr 2019 22:49:56 +0900 (JST)
Subject: [ruby-changes:55511] Takashi Kokubun:daff4cbd6c (trunk): Add `make fetch-github` and `make mer=ge-github`=
Takashi Kokubun 2019-04-24 22:40:54 +0900 (Wed, 24 Apr 2019) New Revision: daff4cbd6c https://git.ruby-lang.org/ruby.git/commit/?id=3Ddaff4cbd6c Log: Add `make fetch-github` and `make merge-github` = Closes: https://github.com/ruby/ruby/pull/2147 Modified files: defs/gmake.mk= From daff4cbd6c7d6be07ae094bda45bca076b37a375 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Wed, 24 Apr 2019 22:40:54 +0900 Subject: Add `make fetch-github` and `make merge-github` Closes: https://github.com/ruby/ruby/pull/2147 diff --git a/defs/gmake.mk b/defs/gmake.mk index edd115c..9a11df1 100644 --- a/defs/gmake.mk +++ b/defs/gmake.mk @@ -153,6 +153,33 @@ commit: $(if $(filter commit,$(MAKECMDGOALS)),$(filter-out commit,$(MAKECMDGOALS https://github.com/ruby/ruby/blob/trunk/#L153 VCSUP="" ENC_MK=.top-enc.mk REVISION_FORCE=PHONY CONFIGURE="$(CONFIGURE)" -f - \ update-src srcs all-incs +PR = +GITHUB_RUBY_URL = https://github.com/ruby/ruby + +.PHONY: fetch-github +fetch-github: + $(Q) if [ -z "$(PR)" ]; then \ + echo "usage:"; echo " make $@ PR=1234"; \ + exit 1; \ + fi + $(Q) if ! git config remote.github.url > /dev/null; then \ + echo adding $(GITHUB_RUBY_URL) as remote github; \ + git -C "$(srcdir)" remote add github $(GITHUB_RUBY_URL); \ + fi + git -C "$(srcdir)" fetch -f github "pull/$(PR)/head:gh-$(PR)" + +.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 - + git -C "$(srcdir)" merge --ff-only "gh-$(PR)" + git -C "$(srcdir)" branch -D "gh-$(PR)" + git -C "$(srcdir)" filter-branch -f --msg-filter \ + 'cat && echo && echo "Closes: $(GITHUB_RUBY_URL)/pull/$(PR)"' \ + -- "$(GITHUB_MERGE_BASE)..@" + ifeq ($(words $(filter update-gems extract-gems,$(MAKECMDGOALS))),2) extract-gems: update-gems endif -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/