Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-24 Thread Taylor Blau
On Tue, Apr 24, 2018 at 03:13:55PM +0900, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > > > I think when we add features to git-grep we should be as close to GNU > > grep as possible (e.g. not add this -m alias meaning something different > > as in your v1), but if GNU grep doesn't hav

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > I think when we add features to git-grep we should be as close to GNU > grep as possible (e.g. not add this -m alias meaning something different > as in your v1), but if GNU grep doesn't have something go with the trend > of other grep tools, as noted at > https:

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Taylor Blau
On Mon, Apr 23, 2018 at 10:01:17AM +0200, Ævar Arnfjörð Bjarmason wrote: > > On Mon, Apr 23 2018, Taylor Blau wrote: > > > For your consideration: > > https://github.com/ttaylorr/git/compare/tb/grep-colno > > Looks good to me aside from two minor issues I noticed: > > * In "grep.c: display column

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Taylor Blau
On Mon, Apr 23, 2018 at 03:34:21AM -0400, Eric Sunshine wrote: > On Mon, Apr 23, 2018 at 3:27 AM, Ævar Arnfjörð Bjarmason > wrote: > > On Mon, Apr 23 2018, Eric Sunshine wrote: > >> One important issue I noticed is that patch 3/7 neglects to update > >> grep.c:init_grep_defaults() to initialize op

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Ævar Arnfjörð Bjarmason
On Mon, Apr 23 2018, Taylor Blau wrote: > For your consideration: https://github.com/ttaylorr/git/compare/tb/grep-colno Looks good to me aside from two minor issues I noticed: * In "grep.c: display column number of first match" you use a comment style we don't normally use, i.e. /**\n not /

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Eric Sunshine
On Mon, Apr 23, 2018 at 3:27 AM, Ævar Arnfjörð Bjarmason wrote: > On Mon, Apr 23 2018, Eric Sunshine wrote: >> One important issue I noticed is that patch 3/7 neglects to update >> grep.c:init_grep_defaults() to initialize opt.color_columnno. > > I think this is fine for fields that are 0 by defau

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Ævar Arnfjörð Bjarmason
On Mon, Apr 23 2018, Eric Sunshine wrote: > On Sun, Apr 22, 2018 at 9:17 PM, Taylor Blau wrote: > One important issue I noticed is that patch 3/7 neglects to update > grep.c:init_grep_defaults() to initialize opt.color_columnno. I think this is fine for fields that are 0 by default, since the s

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-22 Thread Eric Sunshine
On Sun, Apr 22, 2018 at 9:17 PM, Taylor Blau wrote: > On Sun, Apr 22, 2018 at 08:16:12PM -0400, Eric Sunshine wrote: >> One way to achieve a more coherent patch series would be to build the >> machinery first and then expose it to the user in various ways. Also, >> each patch which implements some

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-22 Thread Taylor Blau
On Sun, Apr 22, 2018 at 08:16:12PM -0400, Eric Sunshine wrote: > On Sun, Apr 22, 2018 at 4:47 PM, Taylor Blau wrote: > > show_line() currently receives the line number within the > > 'grep_opt->buf' in order to determine which line number to display. In > > order to display information about the m

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-22 Thread Eric Sunshine
On Sun, Apr 22, 2018 at 4:47 PM, Taylor Blau wrote: > show_line() currently receives the line number within the > 'grep_opt->buf' in order to determine which line number to display. In > order to display information about the matching column number--if > requested--we must additionally take in tha

[PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-22 Thread Taylor Blau
show_line() currently receives the line number within the 'grep_opt->buf' in order to determine which line number to display. In order to display information about the matching column number--if requested--we must additionally take in that information. To do so, we extend the signature of show_lin