Re: [PATCH v2 0/6] Teach '--column-number' to 'git-grep(1)'

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

 



On Mon, Apr 23, 2018 at 08:28:14AM +0900, Junio C Hamano wrote:
> Taylor Blau <me@xxxxxxxxxxxx> writes:
>
> > diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
> > index 0cf654824d..7349c7fadc 100755
> > --- a/t/t7810-grep.sh
> > +++ b/t/t7810-grep.sh
> > @@ -106,7 +106,7 @@ do
> >  			echo ${HC}file:5:foo mmap bar_mmap
> >  			echo ${HC}file:14:foo_mmap bar mmap baz
> >  		} >expected &&
> > -		git -c grep.linenumber=false grep -m -w -e mmap $H >actual &&
> > +		git grep --column-number -w -e mmap $H >actual &&
> >  		test_cmp expected actual
> >  	'
> >
> > @@ -117,7 +117,7 @@ do
> >  			echo ${HC}file:4:5:foo mmap bar_mmap
> >  			echo ${HC}file:5:14:foo_mmap bar mmap baz
> >  		} >expected &&
> > -		git -c grep.linenumber=false grep -n -m -w -e mmap $H >actual &&
> > +		git grep -n --column-number -w -e mmap $H >actual &&
> >  		test_cmp expected actual
> >  	'
>
> It seems that these two used to be "even when it is configured not
> to show linenumber, with -n it is shown and without -n it is not,
> when the new --column-number feature forces the command to show the
> "filename plus colon plus location info plus coon" header.  I'm
> guessing that the reason why these got changed this round is because
> the old way was found too defensive (perhaps nobody sets
> grep.linenumber in .git/config in the tests that come before these)?

Sort of. My aim with these new tests is to ensure that git-grep(1) works
with:

  - '--line-number'
  - '--column-number'
  - '--line-number' and '--column-number' together

It seemed unrelated to be testing the various permutations of
grep.linenumber and --line-number along with the above three so I
removed these in order to focus only on the above three.

Do you think that it is worth testing --column-number with and without
grep.columnnumber as above?


Thanks,
Taylor



[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]

  Powered by Linux