git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git diff --ignore-space-at-eol issue
@ 2012-12-21 15:04 John Moon
  2012-12-28 16:46 ` Antoine Pelisse
  0 siblings, 1 reply; 4+ messages in thread
From: John Moon @ 2012-12-21 15:04 UTC (permalink / raw
  To: git


Hi all,

The --ignore-space-at-eol option is ignored when used in conjunction 
with --name-status.
It works fine otherwise.

$ git init
Initialized empty Git repository in /tmp/test/.git/
$ printf "hello\r\n" > test.txt
$git -c core.autocrlf=false add test.txt
$git commit -m.
[master (root-commit) 5c4ce92] .
1 file changed, 1 insertion(+)
create mode 100644 test.txt
$ printf "hello" > test.txt
$ git diff --ignore-space-at-eol test.txt
$ git diff --stat --ignore-space-at-eol test.txt
0 files changed
$ git diff --name-status --ignore-space-at-eol test.txt
M test.txt


Thanks.

 		 	   		  

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

* Re: git diff --ignore-space-at-eol issue
  2012-12-21 15:04 git diff --ignore-space-at-eol issue John Moon
@ 2012-12-28 16:46 ` Antoine Pelisse
  2012-12-28 19:59   ` John Moon
  0 siblings, 1 reply; 4+ messages in thread
From: Antoine Pelisse @ 2012-12-28 16:46 UTC (permalink / raw
  To: John Moon; +Cc: git

> The --ignore-space-at-eol option is ignored when used in conjunction
> with --name-status.
> It works fine otherwise.

Indeed the behavior of diff --stat, and etc has been corrected very
recently to make it more consistent across all options.
I don't know if the new behavior is exactly what you expected:

$ git diff --ignore-space-at-eol test.txt
$ git diff --ignore-space-at-eol --stat test.txt
 test.txt | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
$ git diff --ignore-space-at-eol --name-status test.txt
M       test.txt

The idea is that even though diff doesn't show any differences, stat,
shortstat, numstat and name-status reports the file as being changed.
This is available since v1.8.1-rc0.

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

* RE: git diff --ignore-space-at-eol issue
  2012-12-28 16:46 ` Antoine Pelisse
@ 2012-12-28 19:59   ` John Moon
  2012-12-28 20:33     ` Antoine Pelisse
  0 siblings, 1 reply; 4+ messages in thread
From: John Moon @ 2012-12-28 19:59 UTC (permalink / raw
  To: apelisse; +Cc: git



> $ git diff --ignore-space-at-eol test.txt
> $ git diff --ignore-space-at-eol --stat test.txt
> test.txt | 0
> 1 file changed, 0 insertions(+), 0 deletions(-)
> $ git diff --ignore-space-at-eol --name-status test.txt
> M test.txt
>
> The idea is that even though diff doesn't show any differences, stat,
> shortstat, numstat and name-status reports the file as being changed.
> This is available since v1.8.1-rc0.

Thanks for the info.  Unfortunately it's not what i would expect.  
If i told git diff specifically to ignore line endings, why is --name-status  showing me a file as being modified when the only modification is the very thing i told it to ignore.  
The same thing for --stat, why is it showing me a file with zero changes?  Just my opinion though.

I'll tell you why this is a problem for me, basically what i am doing is running the "git diff --ignore-space-at-eol --name-status "  on my root directory to give to someone else who is not using git to give them the files that i have modified.  I don't want to give them a file where only the line ending has changed.

Cheers. 		 	   		  

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

* Re: git diff --ignore-space-at-eol issue
  2012-12-28 19:59   ` John Moon
@ 2012-12-28 20:33     ` Antoine Pelisse
  0 siblings, 0 replies; 4+ messages in thread
From: Antoine Pelisse @ 2012-12-28 20:33 UTC (permalink / raw
  To: John Moon; +Cc: git

Then you should give the output of diff --stat, and he will be able to
ignore files with no changes.

The change was originally made for permission changes. diff --stat
needs to show files have changed even though, indeed, there is no diff
output.

You could also use --numstat and filter out files with no changes
(starting by 0 0).

On Fri, Dec 28, 2012 at 8:59 PM, John Moon <johnmoon77@hotmail.com> wrote:
>
>
>> $ git diff --ignore-space-at-eol test.txt
>> $ git diff --ignore-space-at-eol --stat test.txt
>> test.txt | 0
>> 1 file changed, 0 insertions(+), 0 deletions(-)
>> $ git diff --ignore-space-at-eol --name-status test.txt
>> M test.txt
>>
>> The idea is that even though diff doesn't show any differences, stat,
>> shortstat, numstat and name-status reports the file as being changed.
>> This is available since v1.8.1-rc0.
>
> Thanks for the info.  Unfortunately it's not what i would expect.
> If i told git diff specifically to ignore line endings, why is --name-status  showing me a file as being modified when the only modification is the very thing i told it to ignore.
> The same thing for --stat, why is it showing me a file with zero changes?  Just my opinion though.
>
> I'll tell you why this is a problem for me, basically what i am doing is running the "git diff --ignore-space-at-eol --name-status "  on my root directory to give to someone else who is not using git to give them the files that i have modified.  I don't want to give them a file where only the line ending has changed.
>
> Cheers.

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

end of thread, other threads:[~2012-12-28 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-21 15:04 git diff --ignore-space-at-eol issue John Moon
2012-12-28 16:46 ` Antoine Pelisse
2012-12-28 19:59   ` John Moon
2012-12-28 20:33     ` Antoine Pelisse

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).