git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Add "git grep" helper
Date: Mon, 12 Sep 2005 15:31:58 -0700	[thread overview]
Message-ID: <7virx57w9t.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0509121500400.3266@g5.osdl.org> (Linus Torvalds's message of "Mon, 12 Sep 2005 15:12:32 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> Actually, the more I think about it, the more I think Morten was right, 
> and the git-grep case statement should just put all flags in "$flags", and 
> any git-ls-files flags can be handled specially before.
>
> We also need special casing for grep flags that take an argument.  So the
> end result might be something like the following..

Arrrrrrrrrrrrrrrrrrrgh.

Now, whose grep are we going to support?  Should we teach every
flag GNU grep supports that can take a parameter to the script?

Can we cheat and do something like this instead?

    git grep -B 6 -A 2 frotz -- arch/i386
    git grep -B 6 -A 2 frotz --others arch/i386

That is, things up to a known git-ls-files flag  or -- are
passed to grep and the rest is given to git-ls-files.

      parent reply	other threads:[~2005-09-12 22:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-12 19:06 Add "git grep" helper Linus Torvalds
2005-09-12 20:57 ` Morten Welinder
2005-09-12 21:37   ` Linus Torvalds
2005-09-12 21:45 ` Junio C Hamano
2005-09-12 22:12   ` Linus Torvalds
2005-09-12 22:22     ` Improve "git grep" flags handling Linus Torvalds
2005-09-12 22:37       ` Junio C Hamano
2005-09-12 22:43         ` Linus Torvalds
2005-09-12 23:26           ` Junio C Hamano
2005-09-12 23:46             ` Linus Torvalds
2005-09-12 23:55               ` Junio C Hamano
2005-09-13  0:51               ` [PATCH] " Junio C Hamano
2005-09-13 17:39                 ` Horst von Brand
2005-09-13 17:51                   ` Linus Torvalds
2005-09-13 18:53                   ` Junio C Hamano
2005-09-13 19:09                     ` Linus Torvalds
2005-09-12 22:31     ` Junio C Hamano [this message]

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=7virx57w9t.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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).