All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@mellanox.co.il>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] add -C[NUM] to git-am
Date: Wed, 7 Feb 2007 22:15:11 +0200	[thread overview]
Message-ID: <20070207201511.GF12140@mellanox.co.il> (raw)


Add -C[NUM] to git-am so that patches can be applied even
if context has changed a bit.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>

---

I just had to apply a largish number of patches on a project
that has evolved since, and I found the following to be useful.

What do others think.

diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index aa4ce1d..f7d551e 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -64,6 +64,10 @@ default.   You could use `--no-utf8` to override this.
 	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.
 
diff --git a/git-am.sh b/git-am.sh
index 1252f26..9a61234 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -3,7 +3,7 @@
 # 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
@@ -106,7 +106,8 @@ It does not apply to blobs recorded in its index."
 }
 
 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
@@ -142,7 +143,10 @@ 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 ;;
@@ -394,7 +398,7 @@ do
 
 	case "$resolved" in
 	'')
-		git-apply $binary --index $ws "$dotest/patch"
+		git-apply $git_apply_opt $binary --index "$dotest/patch"
 		apply_status=$?
 		;;
 	t)

-- 
MST

             reply	other threads:[~2007-02-07 20:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 20:15 Michael S. Tsirkin [this message]
2007-02-07 20:23 ` [PATCH] add -C[NUM] to git-am Junio C Hamano
2007-02-07 21:19   ` Michael S. Tsirkin
2007-02-08  7:52     ` Junio C Hamano
2007-02-08  8:35       ` Jakub Narebski
2007-02-08 13:57       ` Michael S. Tsirkin
2007-02-08 23:04         ` Junio C Hamano
2007-02-07 23:50   ` Johannes Schindelin
2007-02-07 23:54     ` Jakub Narebski
2007-02-08  0:07       ` Johannes Schindelin
2007-02-08  0:17         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070207201511.GF12140@mellanox.co.il \
    --to=mst@mellanox.co.il \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.