git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 3/3] completion: offer ctags symbol names for 'git log -S', '-G' and '-L:'
Date: Sat, 1 Apr 2017 04:50:58 -0400	[thread overview]
Message-ID: <20170401085058.y7u73x6beqgnhrcb@sigill.intra.peff.net> (raw)
In-Reply-To: <20170330100656.18766-1-szeder.dev@gmail.com>

On Thu, Mar 30, 2017 at 12:06:56PM +0200, SZEDER Gábor wrote:

> >   1. You still have to come up with the filename yourself for "-L".
> 
> I was already quite satisfied that both the symbol name and the 
> filename can be TAB completed...  but right, in most cases the
> function name uniquely determines the filename, and even when it
> doesn't, it still significantly limits the possibilities.  Hmhm.

I find that I often forget which file a function is defined in,
especially in Git's code base (where it sometimes feels somewhat
random :) ).

> OTOH, the proof-of-concept patch at the bottom shows how we could
> start doing filename completion based on the ctags file, and I think
> it's really convenient to use.  Alas, it doesn't work when the
> funcname is not on its own, e.g. ends with that disambiguating '\(:'
> from above, and then Bash falls back to its own filename completion.
> However, if I may extrapolate from my ~/.bash_history, this would
> still help the great majority of the cases.

Yeah, I think that would go a long way to solving my problem.

> > I have a script (below) which makes this easier (and I complete its
> > argument using the tags file).  It's probably too gross to even go into
> > contrib, but I thought I'd share.
> 
> Perhaps 'git log -L' could be enhanced to just DWIM when it gets only
> '-L:func:', and show the log of that function, wherever it is defined.
> So instead of complaining about the missing filename, it could run
> 'grep <func>' with a bit of magic to find the filename where the
> matching function is declared, and search in the history of that file.
> 
> But then again, 'git log -L' could be enhanced in so many ways...

Yes, that sounds even nicer.

-Peff

      reply	other threads:[~2017-04-01  8:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 15:38 [PATCH 0/3] completion: updates to ctags symbol names SZEDER Gábor
2017-03-23 15:38 ` [PATCH 1/3] completion: put matching ctags symbol names directly into COMPREPLY SZEDER Gábor
2017-03-24  0:37   ` Jeff King
2017-03-23 15:38 ` [PATCH 2/3] completion: extract completing ctags symbol names into helper function SZEDER Gábor
2017-03-24  0:40   ` Jeff King
2017-03-23 15:38 ` [PATCH 3/3] completion: offer ctags symbol names for 'git log -S', '-G' and '-L:' SZEDER Gábor
2017-03-24  0:52   ` Jeff King
2017-03-30 10:06     ` SZEDER Gábor
2017-04-01  8:50       ` Jeff King [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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20170401085058.y7u73x6beqgnhrcb@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder.dev@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).