Re: [PATCH 1/6] t4030: demonstrate behavior of show with textconv

2013-04-20 Thread Michael J Gruber
Jeff King venit, vidit, dixit 20.04.2013 06:04:
> On Fri, Apr 19, 2013 at 06:44:44PM +0200, Michael J Gruber wrote:
> 
>> "git show " obeys the textconc setting while "git show "
>> does not. Demonstrate this in the test.
> 
> s/textconc/textconv

Thanks, plus s/obey/honor/

>> diff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh
>> index 53ec330..f314ced 100755
>> --- a/t/t4030-diff-textconv.sh
>> +++ b/t/t4030-diff-textconv.sh
>> @@ -58,6 +58,12 @@ test_expect_success 'diff produces text' '
>>  test_cmp expect.text actual
>>  '
>>  
>> +test_expect_success 'show commit produces text' '
>> +git show HEAD >diff &&
>> +find_diff actual &&
>> +test_cmp expect.text actual
>> +'
> 
> Makes sense.
> 
>> +test_expect_success 'show blob produces binary' '
>> +git show HEAD:file >actual &&
>> +printf "\\0\\n\\1\\n" >expect &&
>> +test_cmp expect actual
>> +'
> 
> I think this is probably the right thing. I can see instances where one
> would want the converted contents, but we have "cat-file --textconv" for
> that.
> 

By that you mean that this behavior is to stay as is?

My reasoning is twofold:

- consistency between "git show commit" and "git show blob"

- "git show" is a user facing command, and as such should produce output
consumable by humans; whereas "git cat-file" is plumbing and should
produce raw data unless told otherwise (-p, --textconv).

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] t4030: demonstrate behavior of show with textconv

2013-04-19 Thread Jeff King
On Fri, Apr 19, 2013 at 06:44:44PM +0200, Michael J Gruber wrote:

> "git show " obeys the textconc setting while "git show "
> does not. Demonstrate this in the test.

s/textconc/textconv

> diff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh
> index 53ec330..f314ced 100755
> --- a/t/t4030-diff-textconv.sh
> +++ b/t/t4030-diff-textconv.sh
> @@ -58,6 +58,12 @@ test_expect_success 'diff produces text' '
>   test_cmp expect.text actual
>  '
>  
> +test_expect_success 'show commit produces text' '
> + git show HEAD >diff &&
> + find_diff actual &&
> + test_cmp expect.text actual
> +'

Makes sense.

> +test_expect_success 'show blob produces binary' '
> + git show HEAD:file >actual &&
> + printf "\\0\\n\\1\\n" >expect &&
> + test_cmp expect actual
> +'

I think this is probably the right thing. I can see instances where one
would want the converted contents, but we have "cat-file --textconv" for
that.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html