Re: [PATCH/RFC] blame: CRLF in the working tree and LF in the repo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Torsten Bögershausen <tboegi@xxxxxx> writes:

> What do you think about the following test cases for a V2 patch ?
>
> test_expect_success 'create blamerepo' '
>     test_create_repo blamerepo &&
>     (
>         cd blamerepo &&
>         printf "testcase\r\n" >crlffile &&
>         git -c core.autocrlf=false add crlffile &&
>         git commit -m "add files" &&
>         git -c core.autocrlf=false blame crlffile >crlfclean.txt
>     )
> '
>
> test_expect_success 'blaming files with CRLF newlines in repo, core.autoclrf=input' '
>     (
>         cd blamerepo &&
>         git -c core.autocrlf=input blame crlffile >actual &&
>         grep "Not Committed Yet" actual

Are you interested in seeing just some of the lines to show up as
"Not commited yet", or all of them?  I think it would be the latter,
so perhaps 

    ! grep -v "Not Committed Yet" actual

or something?

>     )
> '
>
>

Two blank lines only here?

> test_expect_success 'blaming files with CRLF newlines core.autocrlf=true' '
>     (
>         cd blamerepo &&
>         git -c core.autocrlf=true blame crlffile >actual &&
>         test_cmp crlfclean.txt actual
>     )
> '

OK

> test_expect_success 'blaming files with CRLF newlines core.autocrlf=false' '
>     (
>         cd blamerepo &&
>         git -c core.autocrlf=false blame crlffile >actual &&
>         test_cmp crlfclean.txt actual
>     )
> '

Hmm, how's this blame invocation any different from the one done in
the set-up step at the very beginning?  In other words, I am not sure
what kind of breakage could cause this step to fail.

I see there is no "git blame HEAD crlffile" that bypasses the fake
latest commit altogether.  Wouldn't that be the most appropriate
thing to compare against (i.e. how to create crlfclean.txt in the
set-up step)?

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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]