author | Björn Gustavsson <bgustavsson@gmail.com> | |
Thu, 29 Oct 2009 22:08:31 +0000 (23:08 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 30 Oct 2009 23:02:26 +0000 (16:02 -0700) | ||
commit | 134748353b2a71a34f899c9b1326ccf7ae082412 | |
tree | aecf089b81630334a9306a734af1c126195e56f2 | tree | snapshot |
parent | cd0f8e6d63d3e2744d7d3b2329238be7d064a8ea | commit | diff |
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>
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>
Documentation/merge-options.txt | diff | blob | history | |
builtin-merge.c | diff | blob | history | |
git-pull.sh | diff | blob | history | |
t/t7600-merge.sh | diff | blob | history |