Re: white spaces in a patch

10 messages, 6 authors, 2016-06-15 · open the first message on its own page

Re: white spaces in a patch

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:47

"Mark Ryden" [off-list ref] writes:
1) Is there a way to check whether there are white spaces in this
file without running git-apply?
"sed -n -e '/^+.*[ 	]$/p' patch.txt" perhaps?
2) Is there a way to get some messages about that there are white spaces
when creating a git patch?
Doesn't "git diff" highlight whitespace errors?  That way, you can catch
errors  before you make a commit that has them.

Re: white spaces in a patch

From: Mark Ryden <hidden>
Date: 2016-06-15 22:45:47

Hello,

I tried:
git apply patch1.txt
patch1.txt:34: trailing whitespace.
				
patch1.txt:53: trailing whitespace.

And
"git diff"  show differences but **does not**
highlight anything.
I tried in tchs and in Bash.

Any ideas ? does "git diff" does  highlight for anyone ?

Rgs,
Mark


On Wed, Dec 17, 2008 at 9:34 AM, Junio C Hamano [off-list ref] wrote:
"Mark Ryden" [off-list ref] writes:
quoted
1) Is there a way to check whether there are white spaces in this
file without running git-apply?
"sed -n -e '/^+.*[      ]$/p' patch.txt" perhaps?
quoted
2) Is there a way to get some messages about that there are white spaces
when creating a git patch?
Doesn't "git diff" highlight whitespace errors?  That way, you can catch
errors  before you make a commit that has them.

Re: white spaces in a patch

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:45:47

Hi,

On Tue, 16 Dec 2008, Junio C Hamano wrote:
"Mark Ryden" [off-list ref] writes:
quoted
2) Is there a way to get some messages about that there are white 
   spaces when creating a git patch?
Doesn't "git diff" highlight whitespace errors?  That way, you can catch 
errors before you make a commit that has them.
Not to mention "git diff --check", which should catch them, too.

Ciao,
Dscho

Re: white spaces in a patch

From: Mark Ryden <hidden>
Date: 2016-06-15 22:45:47

Hello,
Thanks!

"git diff --check" indeed tells about trailing whitespace
Mark

On Wed, Dec 17, 2008 at 2:08 PM, Johannes Schindelin
[off-list ref] wrote:
Hi,

On Tue, 16 Dec 2008, Junio C Hamano wrote:
quoted
"Mark Ryden" [off-list ref] writes:
quoted
2) Is there a way to get some messages about that there are white
   spaces when creating a git patch?
Doesn't "git diff" highlight whitespace errors?  That way, you can catch
errors before you make a commit that has them.
Not to mention "git diff --check", which should catch them, too.

Ciao,
Dscho

Re: white spaces in a patch

From: Mark Ryden <hidden>
Date: 2016-06-15 22:45:47

What do you mean ?
where ? how ?
Mark

On Wed, Dec 17, 2008 at 2:13 PM, Sverre Rabbelier [off-list ref] wrote:
On Wed, Dec 17, 2008 at 12:44, Mark Ryden [off-list ref] wrote:
quoted
Any ideas ? does "git diff" does  highlight for anyone ?
Do you have color on?

--
Cheers,

Sverre Rabbelier

Re: white spaces in a patch

From: Thomas Jarosch <hidden>
Date: 2016-06-15 22:45:47

On Wednesday, 17. December 2008 13:13:34 Mark Ryden wrote:
[colors in diff]
What do you mean ?
where ? how ?
This should do the trick:

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

Thomas

Re: white spaces in a patch

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:45:47

On Wed, Dec 17, 2008 at 13:13, Mark Ryden [off-list ref] wrote:
On Wed, Dec 17, 2008 at 2:13 PM, Sverre Rabbelier [off-list ref] wrote:
quoted
Do you have color on?
$ git config color.diff true


-- 
Cheers,

Sverre Rabbelier

Re: white spaces in a patch

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:45:47

On Wed, Dec 17, 2008 at 12:44, Mark Ryden [off-list ref] wrote:
Any ideas ? does "git diff" does  highlight for anyone ?
Do you have color on?

-- 
Cheers,

Sverre Rabbelier

Re: white spaces in a patch

From: Jeff King <hidden>
Date: 2016-06-15 22:45:47

On Wed, Dec 17, 2008 at 01:15:56PM +0100, Thomas Jarosch wrote:
This should do the trick:

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
These days we have

  git config --global color.ui auto

-Peff

Re: white spaces in a patch

From: Mark Ryden <hidden>
Date: 2016-06-15 22:45:47

Thnks!
In fact, the first line was enough!
git config --global color.diff auto
Mark



On Wed, Dec 17, 2008 at 2:15 PM, Thomas Jarosch
[off-list ref] wrote:
On Wednesday, 17. December 2008 13:13:34 Mark Ryden wrote:
[colors in diff]
quoted
What do you mean ?
where ? how ?
This should do the trick:

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

Thomas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help