Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: Bug in Git-Gui - Creates corrupt patch

From: <hidden>
Date: 2016-06-15 22:46:17

In case anyone else is facing this same situation, a simple script like
this did the trick for me:

------------------------------------------------
#!/bin/bash

find ./ -type f | grep -v .git | while read filename
do
	last=$(
		tail -c 1 "$filename" | 
		od -x | 
		head -n 1 | 
		awk '{ print $2 }'
	)
	
	if [ "x$last" != "x000a" ]
	then
		echo >> "$filename"
	fi
done
------------------------------------------------

[off-list ref] wrote:

Hannes / List,

Thank you for the advise on "\ No newline at end of file".

I have almost 4,000 files that are formatted with "\ No newline at end
of file".  Does anyone know of an easy way to re-format my files so
that they have a newline at the end?

The files in question are PHP files that are dynamically included, so
I want to prevent arbitrary spaces from showing up in the rendered
pages.

I'm running Linux.  A bash or perl script would be preferable, but
anything will suffice.

Thanks!

quoted
Johannes Sixt [off-list ref] wrote:

4jxDQ6FQee2H@dyweni.com schrieb:  
quoted
3. Using git-gui, try to stage *only* the last line marked for
removal (should be '-	}').

I get 'fatal: corrupt patch at line 22'.    
"Stage/Unstage line" does not work for files that have

\ No newline at end of file

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