git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/3] completion: match ctags symbol names in grep patterns
Date: Tue, 18 Oct 2011 11:04:23 -0400	[thread overview]
Message-ID: <20111018150423.GA11593@sigill.intra.peff.net> (raw)
In-Reply-To: <7vd3duixdg.fsf@alter.siamese.dyndns.org>

On Tue, Oct 18, 2011 at 12:15:23AM -0700, Junio C Hamano wrote:

> > It's debatable whether this belongs in the generic completion code, as
> > it really only works if your project uses ctags. But I find it to be a
> > huge timesaver for finding callsites of functions, especially when
> > coupled with "git jump grep" from the previous patch.
> 
> Could you elaborate a bit more on how this would help for finding
> callsites? You are looking at a function and do not want to break its
> callers, so at that point presumably you already know the name of the
> function, no?
> 
> Ahh, Ok, you do not necessarily want to type the long function name.

Exactly. Actually, it is often not so much "do not want to type" as
"cannot remember the exact name", but the effect is the same. :)

I use the same completion for "vim -t" which will jump to the
definition.

> By the way, I notice that "make tags" runs "find ." looking for any files
> and directories that match "*.[hcS]" (so do $(ETAGS_TARGET) and cscope),
> without even excluding .git metadirectory.
> 
> Perhaps something like this is in order?
> [...]
> +FIND_SOURCE_FILES = git ls-files '*.[hcS]'

Makes sense to me. I doubt it matters much in practice, though, as we
don't tend to have random untracked source files lying around.

My version of ctags will actually do the recursion itself with "ctags
-R", picking out any files with with languages it knows about. But maybe
not all versions do that.

Also, I have often found myself trying to do completion on shell
functions. I wonder if it's worth adding them to the list (again, my
version of ctags understands bourne shell just fine, but I don't know if
all do).

-Peff

  parent reply	other threads:[~2011-10-18 15:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18  4:49 [PATCH 0/3] stupid git tricks Jeff King
2011-10-18  4:52 ` [PATCH 1/3] contrib: add diff highlight script Jeff King
2011-10-18  4:54 ` [PATCH 2/3] contrib: add git-jump script Jeff King
2011-10-18  5:01 ` [PATCH 3/3] completion: match ctags symbol names in grep patterns Jeff King
2011-10-18  7:15   ` Junio C Hamano
2011-10-18  7:26     ` Jonathan Nieder
2011-10-18  7:35       ` Junio C Hamano
2011-10-18  7:41         ` Matthieu Moy
2011-10-18  7:55           ` Junio C Hamano
2011-10-18  7:55         ` Jonathan Nieder
2011-10-18 17:14           ` Junio C Hamano
2011-10-18 15:04     ` Jeff King [this message]
2011-10-21 13:25   ` SZEDER Gábor
2011-10-21 17:22     ` Jeff King
2011-10-21 17:26       ` [PATCHv2 1/3] contrib: add diff highlight script Jeff King
2011-10-21 17:28       ` [PATCH 2/3] contrib: add git-jump script Jeff King
2011-10-21 17:35         ` Jeff King
2011-10-21 17:30       ` [PATCHv2 3/3] completion: match ctags symbol names in grep patterns Jeff King
2011-10-21 17:37         ` [PATCHv2 4/3] completion: use __gitcomp_nl for ctag matching Jeff King
2011-10-23 21:29         ` [PATCHv2 3/3] completion: match ctags symbol names in grep patterns SZEDER Gábor
2011-10-28  6:05           ` Jeff King
2011-10-29 12:47             ` SZEDER Gábor
2011-11-01 15:21               ` Jeff King
2011-11-01 18:14                 ` Junio C Hamano

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=20111018150423.GA11593@sigill.intra.peff.net \
    --to=peff@peff.net \
    --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).