Re: [PATCH v2 6/6] contrib/git-jump/git-jump: use column number when grep-ing
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 22, 2018, 23:27 UTC
- Message-ID
- <20180422232704.GC48072@syl.local>
- In-Reply-To
- <877eoyewss.fsf@evledraar.gmail.com>
On Sun, Apr 22, 2018 at 11:49:39PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 24 quoted lines
>
> On Sun, Apr 22 2018, Taylor Blau wrote:
>
> > This patch adds the '--column-number' synonym '-m' to the default
> > grep command so that callers are brought to the correct line _and_
> > column of each matched location.
> > [...]
> > diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
> > index 80ab0590bc..2706963690 100755
> > --- a/contrib/git-jump/git-jump
> > +++ b/contrib/git-jump/git-jump
> > @@ -52,7 +52,7 @@ mode_merge() {
> > # editor shows them to us in the status bar.
> > mode_grep() {
> > cmd=$(git config jump.grepCmd)
> > - test -n "$cmd" || cmd="git grep -n"
> > + test -n "$cmd" || cmd="git grep -n -m"
> > $cmd "$@" |
> > perl -pe '
> > s/[ \t]+/ /g;
>
> So this re-roll doesn't have the alias -m anymore, but this makes use of
> it. Seems you just forgot to update this from v1, unless I'm missing
> something while skimming this...Ack; another good catch. I have updated this in my copy and will include it in v3.
Thanks, Taylor