Git development
 help / color / mirror / Atom feed
* Rebase fails because of apply.whitespace setting
@ 2009-10-19 23:31 John Feuerstein
  2009-10-19 23:53 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: John Feuerstein @ 2009-10-19 23:31 UTC (permalink / raw)
  To: git

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Rebase fails because of apply.whitespace setting
  2009-10-19 23:31 Rebase fails because of apply.whitespace setting John Feuerstein
@ 2009-10-19 23:53 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2009-10-19 23:53 UTC (permalink / raw)
  To: John Feuerstein; +Cc: git

John Feuerstein <john@feurix.com> writes:

> 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)

I've seen this argued both ways.  Some people seem to be happy that they
can use rebase with whitespace=fix to clean up their mess.  Some people
quite rightly oppose it (I am slightly closer to the latter camp myself,
but that does not count that much).

I'd agree that whitespace=error won't help anybody here.

Perhaps rebase can be taught to take --whitespace=warn from the command
line to override whatever is in the configuration?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-19 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 23:31 Rebase fails because of apply.whitespace setting John Feuerstein
2009-10-19 23:53 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox