git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-merge-ff: fast-forward only merge
@ 2007-06-26  4:01 Sam Vilain
  2007-06-28 11:33 ` Matthias Lederhofer
  0 siblings, 1 reply; 6+ messages in thread
From: Sam Vilain @ 2007-06-26  4:01 UTC (permalink / raw)
  To: git; +Cc: Sam Vilain

This is primarily so that there is an easy switch to 'git-pull' to
be sure to fast forward only.
---
 Documentation/merge-strategies.txt |    5 +++++
 Makefile                           |    2 +-
 git-merge-ff.sh                    |    8 ++++++++
 3 files changed, 14 insertions(+), 1 deletions(-)
 create mode 100644 git-merge-ff.sh

diff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt
index 7df0266..00739bc 100644
--- a/Documentation/merge-strategies.txt
+++ b/Documentation/merge-strategies.txt
@@ -33,3 +33,8 @@ ours::
 	merge is always the current branch head.  It is meant to
 	be used to supersede old development history of side
 	branches.
+
+ff::
+	This is a degenerate merge strategy that always fails, which
+	means that the only time the target branch will change is if
+	there was no merge ("fast-forward" merge only).
diff --git a/Makefile b/Makefile
index 29243c6..6311eb5 100644
--- a/Makefile
+++ b/Makefile
@@ -208,7 +208,7 @@ SCRIPT_SH = \
 	git-tag.sh git-verify-tag.sh \
 	git-applymbox.sh git-applypatch.sh git-am.sh \
 	git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
-	git-merge-resolve.sh git-merge-ours.sh \
+	git-merge-resolve.sh git-merge-ours.sh git-merge-ff.sh \
 	git-lost-found.sh git-quiltimport.sh
 
 SCRIPT_PERL = \
diff --git a/git-merge-ff.sh b/git-merge-ff.sh
new file mode 100644
index 0000000..b0e0f85
--- /dev/null
+++ b/git-merge-ff.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Sam Vilain
+#
+# A degenerate merge strategy that only allows fast-forwarding.
+#
+
+exit 1;
-- 
1.5.2.1.1131.g3b90

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-merge-ff: fast-forward only merge
  2007-06-26  4:01 [PATCH] git-merge-ff: fast-forward only merge Sam Vilain
@ 2007-06-28 11:33 ` Matthias Lederhofer
  2007-06-28 13:01   ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Lederhofer @ 2007-06-28 11:33 UTC (permalink / raw)
  To: Sam Vilain; +Cc: git

Sam Vilain <sam.vilain@catalyst.net.nz> wrote:
> This is primarily so that there is an easy switch to 'git-pull' to
> be sure to fast forward only.
> ---
>  Documentation/merge-strategies.txt |    5 +++++
>  Makefile                           |    2 +-
>  git-merge-ff.sh                    |    8 ++++++++
>  3 files changed, 14 insertions(+), 1 deletions(-)
>  create mode 100644 git-merge-ff.sh

git-merge-ff.sh should be executable, added to .gitignore and the
strategy should be added to the available strategies.

And somehow it did not work for me at all:

% git merge -s ff origin/master
git-merge.sh: needs update   
Trying really trivial in-index merge...
Wonderful.
In-index merge
[..]
% git show HEAD|grep Merge
Merge: 117a93c... f578825...
    Merge commit 'origin/master'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-merge-ff: fast-forward only merge
  2007-06-28 11:33 ` Matthias Lederhofer
@ 2007-06-28 13:01   ` Johannes Schindelin
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2007-06-28 13:01 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: Sam Vilain, git

Hi,

On Thu, 28 Jun 2007, Matthias Lederhofer wrote:

> Sam Vilain <sam.vilain@catalyst.net.nz> wrote:
> > This is primarily so that there is an easy switch to 'git-pull' to
> > be sure to fast forward only.
> > ---
> >  Documentation/merge-strategies.txt |    5 +++++
> >  Makefile                           |    2 +-
> >  git-merge-ff.sh                    |    8 ++++++++
> >  3 files changed, 14 insertions(+), 1 deletions(-)
> >  create mode 100644 git-merge-ff.sh
> 
> git-merge-ff.sh should be executable, added to .gitignore and the
> strategy should be added to the available strategies.
> 
> And somehow it did not work for me at all:
> 
> % git merge -s ff origin/master
> git-merge.sh: needs update   
> Trying really trivial in-index merge...
> Wonderful.
> In-index merge
> [..]
> % git show HEAD|grep Merge
> Merge: 117a93c... f578825...
>     Merge commit 'origin/master'

To prevent something like this to happen, may I suggest adding a really 
simple, small test case?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] git-merge-ff: fast-forward only merge
  2007-06-30  8:56           ` [PATCH] git-remote: allow 'git-remote fetch' as a synonym for 'git fetch' Sam Vilain
@ 2007-06-30  8:56             ` Sam Vilain
  2007-06-30 14:28               ` Johannes Schindelin
  2007-06-30 18:32               ` Matthias Lederhofer
  0 siblings, 2 replies; 6+ messages in thread
From: Sam Vilain @ 2007-06-30  8:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Sam Vilain

This is primarily so that there is an easy switch to 'git-pull' to
be sure to fast forward only.

Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
---
 Documentation/merge-strategies.txt |    5 +++++
 Makefile                           |    2 +-
 git-merge-ff.sh                    |    8 ++++++++
 git-merge.sh                       |    4 ++--
 4 files changed, 16 insertions(+), 3 deletions(-)
 create mode 100644 git-merge-ff.sh

diff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt
index 7df0266..00739bc 100644
--- a/Documentation/merge-strategies.txt
+++ b/Documentation/merge-strategies.txt
@@ -33,3 +33,8 @@ ours::
 	merge is always the current branch head.  It is meant to
 	be used to supersede old development history of side
 	branches.
+
+ff::
+	This is a degenerate merge strategy that always fails, which
+	means that the only time the target branch will change is if
+	there was no merge ("fast-forward" merge only).
diff --git a/Makefile b/Makefile
index 4ea5e45..7fa8fe3 100644
--- a/Makefile
+++ b/Makefile
@@ -210,7 +210,7 @@ SCRIPT_SH = \
 	git-tag.sh git-verify-tag.sh \
 	git-am.sh \
 	git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
-	git-merge-resolve.sh git-merge-ours.sh \
+	git-merge-resolve.sh git-merge-ours.sh git-merge-ff.sh \
 	git-lost-found.sh git-quiltimport.sh git-submodule.sh \
 	git-filter-branch.sh
 
diff --git a/git-merge-ff.sh b/git-merge-ff.sh
new file mode 100644
index 0000000..b0e0f85
--- /dev/null
+++ b/git-merge-ff.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Sam Vilain
+#
+# A degenerate merge strategy that only allows fast-forwarding.
+#
+
+exit 1;
diff --git a/git-merge.sh b/git-merge.sh
index 981d69d..63aa374 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -16,10 +16,10 @@ test -z "$(git ls-files -u)" ||
 LF='
 '
 
-all_strategies='recur recursive octopus resolve stupid ours subtree'
+all_strategies='recur recursive octopus resolve stupid ours subtree ff'
 default_twohead_strategies='recursive'
 default_octopus_strategies='octopus'
-no_trivial_merge_strategies='ours subtree'
+no_trivial_merge_strategies='ours subtree ff'
 use_strategies=
 
 index_merge=t
-- 
1.5.2.1.1131.g3b90

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-merge-ff: fast-forward only merge
  2007-06-30  8:56             ` [PATCH] git-merge-ff: fast-forward only merge Sam Vilain
@ 2007-06-30 14:28               ` Johannes Schindelin
  2007-06-30 18:32               ` Matthias Lederhofer
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2007-06-30 14:28 UTC (permalink / raw)
  To: Sam Vilain; +Cc: Junio C Hamano, git

Hi,

On Sat, 30 Jun 2007, Sam Vilain wrote:

>  Documentation/merge-strategies.txt |    5 +++++
>  Makefile                           |    2 +-
>  git-merge-ff.sh                    |    8 ++++++++
>  git-merge.sh                       |    4 ++--

Still no test script that could tell you if it does what it is supposed to 
be...

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-merge-ff: fast-forward only merge
  2007-06-30  8:56             ` [PATCH] git-merge-ff: fast-forward only merge Sam Vilain
  2007-06-30 14:28               ` Johannes Schindelin
@ 2007-06-30 18:32               ` Matthias Lederhofer
  1 sibling, 0 replies; 6+ messages in thread
From: Matthias Lederhofer @ 2007-06-30 18:32 UTC (permalink / raw)
  To: Sam Vilain; +Cc: git

Sam Vilain <sam.vilain@catalyst.net.nz> wrote:
> This is primarily so that there is an easy switch to 'git-pull' to
> be sure to fast forward only.

Is this still broken or am I just doing something totally wrong?

    % git reset --hard origin/master~15
    HEAD is now at e1341ab... Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk into pm/gitk
    % git merge -s ff origin/master
    Automatic merge failed; fix conflicts and then commit the result.
    [1]    19368 exit 1     git merge -s ff origin/master
    % git merge origin/master   
    Updating e1341ab..7c85173              
    Fast forward
    [..]
     23 files changed, 236 insertions(+), 79 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-30 18:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-26  4:01 [PATCH] git-merge-ff: fast-forward only merge Sam Vilain
2007-06-28 11:33 ` Matthias Lederhofer
2007-06-28 13:01   ` Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2007-06-30  8:56 a bunch of outstanding updates Sam Vilain
2007-06-30  8:56 ` [PATCH] repack: improve documentation on -a option Sam Vilain
2007-06-30  8:56   ` [PATCH] git-svn: use git-log rather than rev-list | xargs cat-file Sam Vilain
2007-06-30  8:56     ` [PATCH] git-svn: cache max revision in rev_db databases Sam Vilain
2007-06-30  8:56       ` [PATCH] GIT-VERSION-GEN: don't convert - delimiter to .'s Sam Vilain
2007-06-30  8:56         ` [PATCH] git-remote: document -n Sam Vilain
2007-06-30  8:56           ` [PATCH] git-remote: allow 'git-remote fetch' as a synonym for 'git fetch' Sam Vilain
2007-06-30  8:56             ` [PATCH] git-merge-ff: fast-forward only merge Sam Vilain
2007-06-30 14:28               ` Johannes Schindelin
2007-06-30 18:32               ` Matthias Lederhofer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).