summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 66e788b)
raw | patch | inline | side by side (parent: 66e788b)
author | Michael S. Tsirkin <mst@mellanox.co.il> | |
Thu, 8 Feb 2007 13:57:08 +0000 (15:57 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 8 Feb 2007 23:23:52 +0000 (15:23 -0800) |
Add -C[NUM] to git-am and git-rebase so that patches can be applied even
if context has changed a bit.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
if context has changed a bit.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-am.txt | patch | blob | history | |
Documentation/git-rebase.txt | patch | blob | history | |
git-am.sh | patch | blob | history | |
git-rebase.sh | patch | blob | history |
index aa4ce1ddb051e9fa57836563d9480e0be5425005..f7d551e2c71ebee44762ea11b161632c4dab4e65 100644 (file)
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
This flag is passed to the `git-apply` program that applies
the patch.
+-C<n>::
+ This flag is passed to the `git-apply` program that applies
+ the patch.
+
--interactive::
Run interactively, just like git-applymbox.
index 977f661b9d7a1b92d27959429c48450a416c08b8..3dff2dfae781e26ebe500d0197c2c98415b748de 100644 (file)
SYNOPSIS
--------
-'git-rebase' [-v] [--merge] [--onto <newbase>] <upstream> [<branch>]
+'git-rebase' [-v] [--merge] [-CNUM] [--onto <newbase>] <upstream> [<branch>]
'git-rebase' --continue | --skip | --abort
-v, \--verbose::
Display a diffstat of what changed upstream since the last rebase.
+-C<n>::
+ Ensure at least <n> lines of surrounding context match before
+ and after each change. When fewer lines of surrounding
+ context exist they all must match. By default no context is
+ ever ignored.
+
include::merge-strategies.txt[]
NOTES
diff --git a/git-am.sh b/git-am.sh
index 1252f26bbd46484f25e58e92680e553f7fd7c1da..9a6123437ea092069fc2c0c29349252f31efd496 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
# Copyright (c) 2005, 2006 Junio C Hamano
USAGE='[--signoff] [--dotest=<dir>] [--utf8 | --no-utf8] [--binary] [--3way]
- [--interactive] [--whitespace=<option>] <mbox>...
+ [--interactive] [--whitespace=<option>] [-CNUM] <mbox>...
or, when resuming [--skip | --resolved]'
. git-sh-setup
set_reflog_action am
}
prec=4
-dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= ws= resolvemsg=
+dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= resolvemsg=
+git_apply_opt=
while case "$#" in 0) break;; esac
do
skip=t; shift ;;
--whitespace=*)
- ws=$1; shift ;;
+ git_apply_opt="$git_apply_opt $1"; shift ;;
+
+ -C*)
+ git_apply_opt="$git_apply_opt $1"; shift ;;
--resolvemsg=*)
resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;;
case "$resolved" in
'')
- git-apply $binary --index $ws "$dotest/patch"
+ git-apply $git_apply_opt $binary --index "$dotest/patch"
apply_status=$?
;;
t)
diff --git a/git-rebase.sh b/git-rebase.sh
index 9d2f71d15c47ae69eed57a7301d47c93d5bb070a..b51d19d12e6d5a108f13c4ec60c5f5a6e560ef47 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
dotest=$GIT_DIR/.dotest-merge
prec=4
verbose=
+git_am_opt=
continue_merge () {
test -n "$prev_head" || die "prev_head must be defined"
-v|--verbose)
verbose=t
;;
+ -C*)
+ git_am_opt=$1
+ shift
+ ;;
-*)
usage
;;
if test -z "$do_merge"
then
git-format-patch -k --stdout --full-index --ignore-if-in-upstream "$upstream"..ORIG_HEAD |
- git am --binary -3 -k --resolvemsg="$RESOLVEMSG"
+ git am $git_am_opt --binary -3 -k --resolvemsg="$RESOLVEMSG"
exit $?
fi