summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorBjörn Gustavsson <bgustavsson@gmail.com>2009-10-29 23:08:31 +0100
committerJunio C Hamano <gitster@pobox.com>2009-10-30 16:02:26 -0700
commit134748353b2a71a34f899c9b1326ccf7ae082412 (patch)
treeaecf089b81630334a9306a734af1c126195e56f2 /Documentation
parentcd0f8e6d63d3e2744d7d3b2329238be7d064a8ea (diff)
downloadgit-134748353b2a71a34f899c9b1326ccf7ae082412.tar.gz
Teach 'git merge' and 'git pull' the option --ff-only
For convenience in scripts and aliases, add the option --ff-only to only allow fast-forwards (and up-to-date, despite the name). Disallow combining --ff-only and --no-ff, since they flatly contradict each other. Allow all other options to be combined with --ff-only (i.e. do not add any code to handle them specially), including the following options: * --strategy (one or more): As long as the chosen merge strategy results in up-to-date or fast-forward, the command will succeed. * --squash: I cannot imagine why anyone would want to squash commits only if fast-forward is possible, but I also see no reason why it should not be allowed. * --message: The message will always be ignored, but I see no need to explicitly disallow providing a redundant message. Acknowledgements: I did look at Yuval Kogman's earlier patch (107768 in gmane), mainly as shortcut to find my way in the code, but I did not copy anything directly. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/merge-options.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index adadf8e4bf..27a9a8489c 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -60,6 +60,11 @@
a fast-forward, only update the branch pointer. This is
the default behavior of git-merge.
+--ff-only::
+ Refuse to merge and exit with a non-zero status unless the
+ current `HEAD` is already up-to-date or the merge can be
+ resolved as a fast-forward.
+
-s <strategy>::
--strategy=<strategy>::
Use the given merge strategy; can be supplied more than