Re: Getting path to a file from arbitrary project directory

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

 



Thank you, it works!

On Fri, 2023-06-23 at 02:52 -0700, Junio C Hamano wrote:
> Konstantin Kharlamov <hi-angel@xxxxxxxxx> writes:
> 
> > 1: the usecase is I have a Emacs helper function to pick up a an
> > aribtrarily mangled path to a file in the project from the primary
> > clipboard and open that file. It's often "mangled", because gdb
> > prints it with `../`, then logs print no path whatsoever, just a
> > filename… So it's generally useful to have.
> 
> Sounds like you are looking for the top (and possibly glob) magic
> pathspec, e.g. in the source tree of Git itself, I can go a few
> levels down into a random directory and get exactly the same listing
> of two files whose name is "rerere.c" located in two directories:
> 
>     $ cd t/helper
>     $ git ls-files --full-name ':(top,glob)**/rerere.c'
>     builtin/rerere.c
>     rerere.c
> 
> Look for magic pathspec in "git help glossary" to learn more.
> 
> 





[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]

  Powered by Linux