Re: [PATCH v2 0/2] Teach "diff" to ignore only CR at EOL

2017-11-07 Thread Stefan Beller
On Tue, Nov 7, 2017 at 7:12 AM, Junio C Hamano  wrote:
> Johannes Schindelin  writes:
>
>> Good. I was wishing for such a feature in the past.
>>
>> However, the short and sweet `-b` or `-w` switches are really, really
>> nice. `--ignore-cr-at-eol` is just very cumbersome to type out. So I think
>> you will want to add this patch to your patch series:
>
> Yeah, I should probably have added that to 2/2 from the beginning.
>
>> -- snipsnap --
>> diff --git a/contrib/completion/git-completion.bash 
>> b/contrib/completion/git-completion.bash
>> index 0e16f017a41..b7a45e8df29 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -1400,7 +1400,7 @@ __git_diff_common_options="--stat --numstat 
>> --shortstat --summary
>>   --patch-with-stat --name-only --name-status --color
>>   --no-color --color-words --no-renames --check
>>   --full-index --binary --abbrev --diff-filter=
>> - --find-copies-harder
>> + --find-copies-harder --ignore-cr-at-eol
>>   --text --ignore-space-at-eol --ignore-space-change
>>   --ignore-all-space --ignore-blank-lines --exit-code
>>   --quiet --ext-diff --no-ext-diff

That series, with this squash, looks good to me.


Re: [PATCH v2 0/2] Teach "diff" to ignore only CR at EOL

2017-11-07 Thread Junio C Hamano
Johannes Schindelin  writes:

> Good. I was wishing for such a feature in the past.
>
> However, the short and sweet `-b` or `-w` switches are really, really
> nice. `--ignore-cr-at-eol` is just very cumbersome to type out. So I think
> you will want to add this patch to your patch series:

Yeah, I should probably have added that to 2/2 from the beginning.

> -- snipsnap --
> diff --git a/contrib/completion/git-completion.bash 
> b/contrib/completion/git-completion.bash
> index 0e16f017a41..b7a45e8df29 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1400,7 +1400,7 @@ __git_diff_common_options="--stat --numstat --shortstat 
> --summary
>   --patch-with-stat --name-only --name-status --color
>   --no-color --color-words --no-renames --check
>   --full-index --binary --abbrev --diff-filter=
> - --find-copies-harder
> + --find-copies-harder --ignore-cr-at-eol
>   --text --ignore-space-at-eol --ignore-space-change
>   --ignore-all-space --ignore-blank-lines --exit-code
>   --quiet --ext-diff --no-ext-diff


Re: [PATCH v2 0/2] Teach "diff" to ignore only CR at EOL

2017-11-07 Thread Johannes Schindelin
Hi Junio,

On Tue, 7 Nov 2017, Junio C Hamano wrote:

> This time with doc updates and tests.  The previous one is at 
> 
> https://public-inbox.org/git/xmqqshe7j0af@gitster.mtv.corp.google.com
> 
> A change that is supposed to only change the end-of-line convention
> between LF <-> CRLF and nothing else can be verified with "diff -b"
> or "diff --ignore-space-at-eol" in practice, but these hide changes
> in whitespaces other than the carriage return at the end of the lines.

Good. I was wishing for such a feature in the past.

However, the short and sweet `-b` or `-w` switches are really, really
nice. `--ignore-cr-at-eol` is just very cumbersome to type out. So I think
you will want to add this patch to your patch series:

-- snipsnap --
diff --git a/contrib/completion/git-completion.bash 
b/contrib/completion/git-completion.bash
index 0e16f017a41..b7a45e8df29 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1400,7 +1400,7 @@ __git_diff_common_options="--stat --numstat --shortstat 
--summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
--full-index --binary --abbrev --diff-filter=
-   --find-copies-harder
+   --find-copies-harder --ignore-cr-at-eol
--text --ignore-space-at-eol --ignore-space-change
--ignore-all-space --ignore-blank-lines --exit-code
--quiet --ext-diff --no-ext-diff


[PATCH v2 0/2] Teach "diff" to ignore only CR at EOL

2017-11-06 Thread Junio C Hamano
This time with doc updates and tests.  The previous one is at 

https://public-inbox.org/git/xmqqshe7j0af@gitster.mtv.corp.google.com

A change that is supposed to only change the end-of-line convention
between LF <-> CRLF and nothing else can be verified with "diff -b"
or "diff --ignore-space-at-eol" in practice, but these hide changes
in whitespaces other than the carriage return at the end of the lines.

These two patches introduce a new --ignore-cr-at-eol option so that
only CR at eol and no other whitespace changes are ignored while
making a comparison, to allow a stricter validation.

I am not sure how much practical value the new option has.  The
preliminary clean-up patch to shuffle the bis assignment for flags
does have values, though ;-).

Junio C Hamano (2):
  xdiff: reassign xpparm_t.flags bits
  diff: --ignore-cr-at-eol

 Documentation/diff-options.txt |  3 +++
 Documentation/merge-strategies.txt |  5 +++--
 diff.c |  6 +++---
 merge-recursive.c  |  2 ++
 t/t4015-diff-whitespace.sh | 28 
 xdiff/xdiff.h  | 26 --
 xdiff/xutils.c | 38 --
 7 files changed, 91 insertions(+), 17 deletions(-)

-- 
2.15.0-263-g47cc852023