redguardtoo / counsel-etags

Fast, energy-saving, and powerful code navigation solution
174 stars 15 forks source link

ctags: cannot open list file "--exclude=*/.git/*" : No such file or directory #61

Closed sandinmyjoints closed 4 years ago

sandinmyjoints commented 4 years ago

After recently updating counsel-etags, I'm now seeing this a lot:

ctags: cannot open list file "--exclude=*/.git/*" : No such file or directory

with this in *Messages* buffer:

command=ctags -e -L --exclude="*/.git/*" --exclude=".git/*" --exclude="*/.svn/*" --exclude=".svn/*" --exclude="*/.cvs/*" --exclude=".cvs/*" --exclude="*/.bzr/*" --exclude=".bzr/*" --exclude="*/.hg/*" --exclude=".hg/*" --exclude="*/bin/*" --exclude="bin/*" --exclude="*/fonts/*" --exclude="fonts/*" --exclude="*/images/*" --exclude="images/*" --exclude="*/.DS_Store/*" --exclude=".DS_Store/*" --exclude="*/.npm/*" --exclude=".npm/*" --exclude="*/.tmp/*" --exclude=".tmp/*" --exclude="*/.sass-cache/*" --exclude=".sass-cache/*" --exclude="*/.idea/*" --exclude=".idea/*" --exclude="*/node_modules/*" --exclude="node_modules/*" --exclude="*/bower_components/*" --exclude="bower_components/*" --exclude="*/.tox/*" --exclude=".tox/*" --exclude="*/.vscode/*" --exclude=".vscode/*" --exclude="*/.cask/*" --exclude=".cask/*" --exclude="*.org" --exclude="*.log" --exclude="rusty-tags.vim" --exclude="rusty-tags.emacs" --exclude="tags" --exclude="TAGS" --exclude="*.tgz" --exclude="*.gz" --exclude="*.xz" --exclude="*.zip" --exclude="*.tar" --exclude="*.rar" --exclude="GTAGS" --exclude="GPATH" --exclude="GRTAGS" --exclude="cscope.files" --exclude="*bundle.js" --exclude="*min.js" --exclude="*min.css" --exclude="*.png" --exclude="*.jpg" --exclude="*.jpeg" --exclude="*.gif" --exclude="*.bmp" --exclude="*.tiff" --exclude="*.ico" --exclude="*.doc" --exclude="*.docx" --exclude="*.xls" --exclude="*.ppt" --exclude="*.pdf" --exclude="*.odt" --exclude=".clang-format" --exclude="*.obj" --exclude="*.so" --exclude="*.o" --exclude="*.a" --exclude="*.ifso" --exclude="*.tbd" --exclude="*.dylib" --exclude="*.lib" --exclude="*.d" --exclude="*.dll" --exclude="*.exe" --exclude=".metadata*" --exclude="*.class" --exclude="*.war" --exclude="*.jar" --exclude="*flymake" --exclude="#*#" --exclude=".#*" --exclude="*.swp" --exclude="*~" --exclude="*.elc" --exclude="*.pyc" -e  --exclude="@/Users/william/scm/sd/neodarwin/.gitignore"  -R 

The project I'm using it in does have a .git directory, fwiw.

I'm using universal ctags (confirmed this is the binary that Emacs finds with executable-find):

$ brew info universal-ctags
universal-ctags/universal-ctags/universal-ctags: HEAD
Maintained ctags implementation
https://github.com/universal-ctags/ctags
Conflicts with:
  ctags (because this formula installs the same executable as the ctags formula)
/usr/local/Cellar/universal-ctags/HEAD-0c78c0c (12 files, 1MB) *
  Built from source on 2020-05-26 at 09:09:00
From: https://github.com/universal-ctags/homebrew-universal-ctags/blob/master/universal-ctags.rb
==> Dependencies
Build: autoconf ✔, automake ✔, pkg-config ✔
Recommended: docutils ✔
Optional: jansson ✔, libyaml ✔
==> Options
--with-jansson
        Build with jansson support
--with-libyaml
        Build with libyaml support
--without-docutils
        Build without docutils support
--without-xml
        Compile without libxml2
--HEAD
        Install HEAD version

Any ideas?

redguardtoo commented 4 years ago

What's the output of running ctags cli in shell? It could be you ~/.ctags setup. Run the cli in shell and fix all the warnings.

sandinmyjoints commented 4 years ago

Hmm, I don't have a ~/.ctags file.

If I run just ctags, I get ctags: No files specified. Try "ctags --help"..

If I run ctags --help:

$ ctags --help
Universal Ctags 0.0.0(0c78c0c), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: May 26 2020, 09:08:52
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv,
+option-directory, +xpath, +case-insensitive-filenames, +packcc

For completion, this is what I see in the Messages buffer:

Failed to create tags file.
error=exited abnormally with code 1

command=ctags -e -L --exclude="*/.git/*" --exclude=".git/*"
--exclude="*/.svn/*" --exclude=".svn/*" --exclude="*/.cvs/*"
--exclude=".cvs/*" --exclude="*/.bzr/*" --exclude=".bzr/*"
--exclude="*/.hg/*" --exclude=".hg/*" --exclude="*/bin/*" --exclude="bin/*"
--exclude="*/fonts/*" --exclude="fonts/*" --exclude="*/images/*"
--exclude="images/*" --exclude="*/.DS_Store/*" --exclude=".DS_Store/*"
--exclude="*/.npm/*" --exclude=".npm/*" --exclude="*/.tmp/*"
--exclude=".tmp/*" --exclude="*/.sass-cache/*" --exclude=".sass-cache/*"
--exclude="*/.idea/*" --exclude=".idea/*" --exclude="*/node_modules/*"
--exclude="node_modules/*" --exclude="*/bower_components/*"
--exclude="bower_components/*" --exclude="*/.tox/*" --exclude=".tox/*"
--exclude="*/.vscode/*" --exclude=".vscode/*" --exclude="*/.cask/*"
--exclude=".cask/*" --exclude="*.org" --exclude="*.log"
--exclude="rusty-tags.vim" --exclude="rusty-tags.emacs" --exclude="tags"
--exclude="TAGS" --exclude="*.tgz" --exclude="*.gz" --exclude="*.xz"
--exclude="*.zip" --exclude="*.tar" --exclude="*.rar" --exclude="GTAGS"
--exclude="GPATH" --exclude="GRTAGS" --exclude="cscope.files"
--exclude="*bundle.js" --exclude="*min.js" --exclude="*min.css"
--exclude="*.png" --exclude="*.jpg" --exclude="*.jpeg" --exclude="*.gif"
--exclude="*.bmp" --exclude="*.tiff" --exclude="*.ico" --exclude="*.doc"
--exclude="*.docx" --exclude="*.xls" --exclude="*.ppt" --exclude="*.pdf"
--exclude="*.odt" --exclude=".clang-format" --exclude="*.obj"
--exclude="*.so" --exclude="*.o" --exclude="*.a" --exclude="*.ifso"
--exclude="*.tbd" --exclude="*.dylib" --exclude="*.lib" --exclude="*.d"
--exclude="*.dll" --exclude="*.exe" --exclude=".metadata*"
--exclude="*.class" --exclude="*.war" --exclude="*.jar"
--exclude="*flymake" --exclude="#*#" --exclude=".#*" --exclude="*.swp"
--exclude="*~" --exclude="*.elc" --exclude="*.pyc" -e
 --exclude="@/Users/william/scm/sd/neodarwin/.gitignore"  -R

On Tue, May 26, 2020 at 9:30 PM Chen Bin notifications@github.com wrote:

What's the output of running ctags cli in shell? Could be you ~/.ctags setup.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/redguardtoo/counsel-etags/issues/61#issuecomment-634369910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEUENFPPUADZPKMPEOSNMLRTRUJTANCNFSM4NLHP6IQ .

-- williamjohnbert.com | github.com/sandinmyjoints | twitter.com/williamjohnbert

redguardtoo commented 4 years ago

see -e -L at the beginning of the cli? What's the value of counsel-etags-tags-program?

Try (setq counsel-etags-tags-program nil) to work around the issue.

Or just upgrade to latest version 4123a05 remove dependency on GNU/BSD find (Chen Bin)

counsel-etags-tags-program is renamed counsel-etags-ctags-program in this version.

sandinmyjoints commented 4 years ago

Thanks, it turns out I was adding those flags in my config and had forgotten about it. Removing them seems to have fixed the issue!

On Tue, May 26, 2020 at 10:34 PM Chen Bin notifications@github.com wrote:

see -e -L at the beginning of the cli? What's the value of counsel-etags-tags-program?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/redguardtoo/counsel-etags/issues/61#issuecomment-634390960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEUENHWG6KKP7XRT3MM2BDRTR3ZZANCNFSM4NLHP6IQ .

-- williamjohnbert.com | github.com/sandinmyjoints | twitter.com/williamjohnbert