From: John Feuerstein <john@feurix.com>
To: git@vger.kernel.org
Subject: Rebase fails because of apply.whitespace setting
Date: Tue, 20 Oct 2009 01:31:53 +0200 [thread overview]
Message-ID: <4ADCF6E9.8090704@feurix.com> (raw)
I had to rewrite history recently (ugh -- private repo, not shared with
anybody) and wanted to change the commit message of the root commit.
During this I've encountered a failing git-rebase if apply.whitespace is
set to "error".
Should whitespace-errors really be detected when rebasing?
(or worse: be "fixed" without explicitely asking for it when using a
global apply.whitespace=fix setting)
What about making --ignore-whitespace the default for git-rebase?
Simplified example:
$ mkdir test
$ cd test/
$ git config apply.whitespace
error
$ git init
Initialized empty Git repository in /home/john/test/.git/
$ git commit --allow-empty -m 'root commit'
[master (root-commit) a208f9f] root commit
$ echo ' ' > whitespace
$ git add whitespace
$ git commit -m 'add whitespace file'
[master 12b685b] add whitespace file
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 whitespace
$ git tag root a208f9f
$ git checkout -b new-root root
Switched to a new branch 'new-root'
$ git commit --amend --allow-empty -m 'changed root commit'
[new-root b9adb89] changed root commit
$ git checkout -
Switched to branch 'master'
$ git rebase --onto new-root root
First, rewinding head to replay your work on top of it...
Applying: add whitespace file
Patch failed at 0001 add whitespace file
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
$ git diff
$ git status
$ git apply .git/rebase-apply/0001
.git/rebase-apply/0001:17: trailing whitespace.
fatal: 1 line adds whitespace errors.
next reply other threads:[~2009-10-19 23:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-19 23:31 John Feuerstein [this message]
2009-10-19 23:53 ` Rebase fails because of apply.whitespace setting 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=4ADCF6E9.8090704@feurix.com \
--to=john@feurix.com \
--cc=git@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox