Re: [PATCH 3/3] completion: offer ctags symbol names for 'git log -S', '-G' and '-L:'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]