# [PATCH] git-rebase: support --whitespace=<option>

2 messages from 2007-09-07 to 2007-09-07. Participants: J. Bruce Fields.
Thread: https://gitlist.dev/t/9816

## J. Bruce Fields, 2007-09-07 14:20

Subject: [PATCH] git-rebase: support --whitespace=<option>
Message-ID: <11891748512757-git-send-email-bfields@citi.umich.edu>
URL: https://gitlist.dev/e/11891748512757-git-send-email-bfields%40citi.umich.edu

```
Pass --whitespace=<option> to git-apply.  Since git-apply and git-am
expect this, I'm always surprised when I try to give it to git-rebase
and it doesn't work.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
 Documentation/git-rebase.txt |    9 +++++++--
 git-rebase.sh                |    5 ++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 61b1810..0858fa8 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -8,8 +8,9 @@ git-rebase - Forward-port local commits to the updated upstream head
 SYNOPSIS
 --------
 [verse]
-'git-rebase' [-i | --interactive] [-v | --verbose] [-m | --merge] [-C<n>]
-	[-p | --preserve-merges] [--onto <newbase>] <upstream> [<branch>]
+'git-rebase' [-i | --interactive] [-v | --verbose] [-m | --merge]
+	[-C<n>] [ --whitespace=<option>] [-p | --preserve-merges]
+	[--onto <newbase>] <upstream> [<branch>]
 'git-rebase' --continue | --skip | --abort
 
 DESCRIPTION
@@ -209,6 +210,10 @@ OPTIONS
 	context exist they all must match.  By default no context is
 	ever ignored.
 
+--whitespace=<nowarn|warn|error|error-all|strip>::
+	This flag is passed to the `git-apply` program
+	(see gitlink:git-apply[1]) that applies the patch.
+
 -i, \--interactive::
 	Make a list of the commits which are about to be rebased.  Let the
 	user edit that list before rebasing.  This mode can also be used to
diff --git a/git-rebase.sh b/git-rebase.sh
index 3bd66b0..52c686f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -216,8 +216,11 @@ do
 	-v|--verbose)
 		verbose=t
 		;;
+	--whitespace=*)
+		git_am_opt="$git_am_opt $1"
+		;;
 	-C*)
-		git_am_opt=$1
+		git_am_opt="$git_am_opt $1"
 		shift
 		;;
 	-*)
-- 
1.5.3

```

## J. Bruce Fields, 2007-09-07 14:20

Subject: [PATCH] git-rebase: fix -C option
Message-ID: <11891748511401-git-send-email-bfields@citi.umich.edu>
URL: https://gitlist.dev/e/11891748511401-git-send-email-bfields%40citi.umich.edu
In-Reply-To: <11891748512757-git-send-email-bfields@citi.umich.edu>

```
The extra shift here causes failure to parse any commandline including
the -C option.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
 git-rebase.sh |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 52c686f..c9942f2 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -221,7 +221,6 @@ do
 		;;
 	-C*)
 		git_am_opt="$git_am_opt $1"
-		shift
 		;;
 	-*)
 		usage
-- 
1.5.3

```
