Hello
"make update" in upstream Gambit drops patches on the local branch; it doesn't merge. Since updating has to be done in steps, this poses a problem if one has local changes.
This patch series solves this. I've tested it for some time now and it works without problems for me.
Christian.
Afficher les réponses par date
This way, the new upstream is merged into the current branch, keeping possible local changes, instead of checking out an unnamed branch only containing the upstream.
Only tested with Git. --- makefile.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/makefile.in b/makefile.in index 9ed3c5c..e016607 100644 --- a/makefile.in +++ b/makefile.in @@ -162,9 +162,9 @@ update-nopull: fake_target $(HG) checkout; \ fi; \ else \ - $(RC) checkout $$next_version-bootstrap && \ + $(RC) merge $$next_version-bootstrap && \ $(MAKE) bootstrap && \ - $(RC) checkout $$next_version && \ + $(RC) merge $$next_version && \ $(MAKE) bootclean bootstrap update; \ fi
This variable specifies the name of the remote which represents the upstream Gambit repository which is to be used for merging.
If this is anything else for the local user than "origin", it can just be overridden by setting the REMOTE environment variable. --- makefile.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/makefile.in b/makefile.in index e016607..f331eaa 100644 --- a/makefile.in +++ b/makefile.in @@ -89,6 +89,8 @@ DISTFILES = $(RCFILES) $(GENDISTFILES) GITDISTFILES = $(GITRCFILES) HGDISTFILES = $(HGRCFILES)
+REMOTE ?= origin + .SUFFIXES:
all:
We will use merge in "update-nopull", so don't do merge here, which would just merge the remote HEAD, possibly leading to conflicts that would need to be resolved manually, only to afterwards check out (or rather, now merge) an older version as part of the bootstrap procedure. Instead, only update the remote here. We also do not use "git fetch", as the current branch might not have the Gambit upstream branch as it's remote, but rely on $(REMOTE) instead.
*NOTE*: the code for Mercurial is not updated because of lack of knowledge of that system by the author of this patch. --- makefile.in | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/makefile.in b/makefile.in index f331eaa..39019e5 100644 --- a/makefile.in +++ b/makefile.in @@ -145,8 +145,7 @@ push: fake_target
pull: fake_target @if test "$(RC)" = "$(GIT)"; then \ - $(GIT) pull && \ - $(GIT) fetch --tags; \ + $(GIT) remote update $(REMOTE); \ else \ $(HG) pull; \ fi
The following assumptions are not true (anymore):
- because of the "change git pull back to fetch in "pull" rule" patch, the previously active branch is not merged with upstream anymore; we do this here instead;
- the master branch might not be the branch that the user is working on locally; blindingly checking out "master" will only derange the working directory
*NOTE*: the code for Mercurial is not updated because of lack of knowledge of that system by the author of this patch. --- makefile.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/makefile.in b/makefile.in index 39019e5..30002c0 100644 --- a/makefile.in +++ b/makefile.in @@ -158,7 +158,7 @@ update-nopull: fake_target fi; \ if test "$$next_version" = ""; then \ if test "$(RC)" = "$(GIT)"; then \ - $(GIT) checkout master; \ + $(GIT) merge $(REMOTE)/master; \ else \ $(HG) checkout; \ fi; \
Only output a warning (not stop execution), since the output from Git is being thrown away (because it is so verbose), and if it would get there because of another git error than that the branch doesn't exist, we would stop for the wrong reason. Only outputting a warning should be enough to help the user figure out what's going wrong and still be safe.
(Question: does this work on all relevant platforms? Redirections are unixy, but since the makefile seems to assume for sh to be available anyway, maybe redirections are not a problem?) --- makefile.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/makefile.in b/makefile.in index 30002c0..44e720a 100644 --- a/makefile.in +++ b/makefile.in @@ -145,6 +145,7 @@ push: fake_target
pull: fake_target @if test "$(RC)" = "$(GIT)"; then \ + $(GIT) rev-parse $(REMOTE)/master > /dev/null 2>&1 || { echo "WARNING: branch '$(REMOTE)/master' does not seem to exist; set the REMOTE environment variable to the name of the correct remote if it is not 'origin'"; }; \ $(GIT) remote update $(REMOTE); \ else \ $(HG) pull; \
For example, my set up has the original Gambit master branch in origin/origin/master, which I'm doing with the following rule in .git/config:
[remote "origin"] url = /usr/src/gambc-v4_4_3-devel/.git fetch = +refs/remotes/origin/*:refs/remotes/origin/origin/*
So I need to set REMOTE to origin/origin; but to update origin/origin we need to call "git remote update origin".
Seems messy? But I don't see how to do this cleaner. --- makefile.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/makefile.in b/makefile.in index 44e720a..ce50ee4 100644 --- a/makefile.in +++ b/makefile.in @@ -146,7 +146,7 @@ push: fake_target pull: fake_target @if test "$(RC)" = "$(GIT)"; then \ $(GIT) rev-parse $(REMOTE)/master > /dev/null 2>&1 || { echo "WARNING: branch '$(REMOTE)/master' does not seem to exist; set the REMOTE environment variable to the name of the correct remote if it is not 'origin'"; }; \ - $(GIT) remote update $(REMOTE); \ + $(GIT) remote update "`echo "$(REMOTE)"| sed 's//.*//'`"; \ else \ $(HG) pull; \ fi