{"thread":{"id":"8726","subject":"[PATCH] git-merge-ff: fast-forward only merge","startedAt":"2007-06-26T04:01:10Z","lastAt":"2007-06-28T13:01:18Z","messageCount":3,"participants":["Sam Vilain","Matthias Lederhofer","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45817","messageId":"1182830470640-git-send-email-sam.vilain@catalyst.net.nz","threadId":"8726","inReplyTo":null,"subject":"[PATCH] git-merge-ff: fast-forward only merge","fromName":"Sam Vilain","fromEmail":"sam.vilain@catalyst.net.nz","sentAt":"2007-06-26T04:01:10Z","receivedAt":"2007-06-26T04:01:10Z","isPatch":true,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"This is primarily so that there is an easy switch to 'git-pull' to\nbe sure to fast forward only.\n---\n Documentation/merge-strategies.txt |    5 +++++\n Makefile                           |    2 +-\n git-merge-ff.sh                    |    8 ++++++++\n 3 files changed, 14 insertions(+), 1 deletions(-)\n create mode 100644 git-merge-ff.sh\n\ndiff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt\nindex 7df0266..00739bc 100644\n--- a/Documentation/merge-strategies.txt\n+++ b/Documentation/merge-strategies.txt\n@@ -33,3 +33,8 @@ ours::\n \tmerge is always the current branch head.  It is meant to\n \tbe used to supersede old development history of side\n \tbranches.\n+\n+ff::\n+\tThis is a degenerate merge strategy that always fails, which\n+\tmeans that the only time the target branch will change is if\n+\tthere was no merge (\"fast-forward\" merge only).\ndiff --git a/Makefile b/Makefile\nindex 29243c6..6311eb5 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -208,7 +208,7 @@ SCRIPT_SH = \\\n \tgit-tag.sh git-verify-tag.sh \\\n \tgit-applymbox.sh git-applypatch.sh git-am.sh \\\n \tgit-merge.sh git-merge-stupid.sh git-merge-octopus.sh \\\n-\tgit-merge-resolve.sh git-merge-ours.sh \\\n+\tgit-merge-resolve.sh git-merge-ours.sh git-merge-ff.sh \\\n \tgit-lost-found.sh git-quiltimport.sh\n \n SCRIPT_PERL = \\\ndiff --git a/git-merge-ff.sh b/git-merge-ff.sh\nnew file mode 100644\nindex 0000000..b0e0f85\n--- /dev/null\n+++ b/git-merge-ff.sh\n@@ -0,0 +1,8 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Sam Vilain\n+#\n+# A degenerate merge strategy that only allows fast-forwarding.\n+#\n+\n+exit 1;\n-- \n1.5.2.1.1131.g3b90\n"},{"id":"45972","messageId":"20070628113346.GA4914@moooo.ath.cx","threadId":"8726","inReplyTo":"1182830470640-git-send-email-sam.vilain@catalyst.net.nz","subject":"Re: [PATCH] git-merge-ff: fast-forward only merge","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-06-28T11:33:46Z","receivedAt":"2007-06-28T11:33:46Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Sam Vilain <sam.vilain@catalyst.net.nz> wrote:\n> This is primarily so that there is an easy switch to 'git-pull' to\n> be sure to fast forward only.\n> ---\n>  Documentation/merge-strategies.txt |    5 +++++\n>  Makefile                           |    2 +-\n>  git-merge-ff.sh                    |    8 ++++++++\n>  3 files changed, 14 insertions(+), 1 deletions(-)\n>  create mode 100644 git-merge-ff.sh\n\ngit-merge-ff.sh should be executable, added to .gitignore and the\nstrategy should be added to the available strategies.\n\nAnd somehow it did not work for me at all:\n\n% git merge -s ff origin/master\ngit-merge.sh: needs update   \nTrying really trivial in-index merge...\nWonderful.\nIn-index merge\n[..]\n% git show HEAD|grep Merge\nMerge: 117a93c... f578825...\n    Merge commit 'origin/master'\n"},{"id":"45976","messageId":"Pine.LNX.4.64.0706281400530.4438@racer.site","threadId":"8726","inReplyTo":"20070628113346.GA4914@moooo.ath.cx","subject":"Re: [PATCH] git-merge-ff: fast-forward only merge","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-28T13:01:18Z","receivedAt":"2007-06-28T13:01:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 28 Jun 2007, Matthias Lederhofer wrote:\n\n> Sam Vilain <sam.vilain@catalyst.net.nz> wrote:\n> > This is primarily so that there is an easy switch to 'git-pull' to\n> > be sure to fast forward only.\n> > ---\n> >  Documentation/merge-strategies.txt |    5 +++++\n> >  Makefile                           |    2 +-\n> >  git-merge-ff.sh                    |    8 ++++++++\n> >  3 files changed, 14 insertions(+), 1 deletions(-)\n> >  create mode 100644 git-merge-ff.sh\n> \n> git-merge-ff.sh should be executable, added to .gitignore and the\n> strategy should be added to the available strategies.\n> \n> And somehow it did not work for me at all:\n> \n> % git merge -s ff origin/master\n> git-merge.sh: needs update   \n> Trying really trivial in-index merge...\n> Wonderful.\n> In-index merge\n> [..]\n> % git show HEAD|grep Merge\n> Merge: 117a93c... f578825...\n>     Merge commit 'origin/master'\n\nTo prevent something like this to happen, may I suggest adding a really \nsimple, small test case?\n\nCiao,\nDscho\n"}]}