git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 0/2] Teach 'git grep' about --open-files-in-pager=[<pager>]
Date: Fri, 26 Mar 2010 12:39:39 +0100	[thread overview]
Message-ID: <36ca99e91003260439x3d60b851g15b8652d50f61c06@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.1003261145500.7596@pacific.mpi-cbg.de>

On Fri, Mar 26, 2010 at 11:48, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> This supports opening the results of a 'git grep' directly in a pager
> (where the pager can be 'vi', too).
>
> This series is purely about convenience, everything the option does can
> be done with a regular script or command line.
>
> But I saw so many people doing their own scripts for that, and in many
> cases, they are subtly broken (e.g.
>
>        git grep -z <expr> | xargs -0r vi +/<expr>
>
> would work as long as you do not have to check the exit status of git
> grep from another script) that I finally decided to go for it and send
> this patch pair.
>
> My most common use case for this is to do something like
>
>        git grep -Ovi SomeJustRenamedFile
>
> to edit all files I might have forgotten to change after a git mv.
>
> (Actually, to be honest, my use case involves -Pvi, but I will have to
> retrain my hands.)
>
> Johannes Schindelin (2):
>  grep: Add the option '--open-files-in-pager'
>  grep -P: allow optional argument specifying the pager (or editor)

Your re-training failed miserable ;-)

I like the idea. But could it make sense to get the line number of the
first match to the filename. In the same syntax as on the console
(i.e. <file>:<line>:)?

I have also the feeling that -O potion does not like pager with
arguments, be it from GIT_PAGER, PAGER, or from the command line.

Regards,
Bert

  parent reply	other threads:[~2010-03-26 11:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 10:48 [PATCH 0/2] Teach 'git grep' about --open-files-in-pager=[<pager>] Johannes Schindelin
2010-03-26 10:49 ` [PATCH 1/2] grep: Add the option '--open-files-in-pager' Johannes Schindelin
2010-03-28  4:09   ` Jonathan Nieder
2010-03-29 17:13     ` Johannes Schindelin
2010-03-29 18:17     ` Junio C Hamano
2010-03-26 10:49 ` [PATCH 2/2] grep -P: allow optional argument specifying the pager (or editor) Johannes Schindelin
2010-03-26 10:50   ` Johannes Schindelin
2010-03-26 11:39 ` Bert Wesarg [this message]
2010-03-26 16:18   ` [PATCH 0/2] Teach 'git grep' about --open-files-in-pager=[<pager>] Johannes Schindelin
2010-03-26 20:07     ` Bert Wesarg
2010-03-26 12:46 ` Jeff King
2010-03-26 16:14   ` Johannes Schindelin
2010-03-26 20:33     ` Jeff King
2010-03-26 19:32   ` Junio C Hamano
2010-03-26 20:50     ` Francis Moreau
2010-03-27  1:09       ` Junio C Hamano
2010-03-27 15:19         ` Francis Moreau
2010-03-27 17:23           ` Junio C Hamano
2010-03-27 20:29             ` Francis Moreau
2010-03-26 19:49   ` Jon Seymour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36ca99e91003260439x3d60b851g15b8652d50f61c06@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).