15

I use pathogen for organizing my vim plugins. I git clone the plugins from github into the vimbundles directory. This way it is simple to update them.

I have problem with the tags generated by pathogen. If the plugin does not have the tags included in its code, pathogen generates them by calling pathogen#helptags(). The tags are generated into the doc folder of the plugin. These files then figure as untracked in git repository.

Do you know a way how to generate tags into a different location? All tags could be on the same place, the goal is not to have them generated to the directory where the plugins live. Can pathogen be convinced to do so?

fifigyuri
  • 5,771
  • 8
  • 30
  • 50

3 Answers3

34

As far as I can tell, pathogen just runs :helptags on the doc directory included in the bundle and vim puts the tags file there. I am not aware of a setting to change this behavior.

I offer my workaround as it's a bit different than the others since I store all of my bundles as submodules of a larger repo. Rather than modifying the repo's .gitignore or .git/config, I just add ignore = untracked to the submodule's entry in .gitmodules, e.g.:

[submodule "vim/bundle/nerdcommenter"]
    path = vim/bundle/nerdcommenter
    url = http://github.com/scrooloose/nerdcommenter.git
    ignore = untracked  
Randy Morris
  • 39,631
  • 8
  • 69
  • 76
  • I like this approach, but for some reason it does not seem to work. I added the `ignore = untracked` line to the relevant section(s) of the gitmodules, but the submodules still show up in the main repo for `git st`. – fifigyuri Dec 04 '10 at 08:47
  • Can you try a fresh checkout of the submodule to ensure you have no other local changes? Also I'm not sure if it matters but try committing the .gitmodules, it may act like.gitignore and not work until committed, I don't remember. – Randy Morris Dec 04 '10 at 12:19
  • This is how I do it. I think, it's the cleanest way, as you shouldn't commit changes to submodules anyway. As helptags are generated on every system anyway, there won't be any incompatibilities due to the uncommited changes. – bestform Feb 07 '11 at 08:22
  • @mattalexx - any information other than it doesn't work? (Also, I just fixed a typo that somehow made it in my paste, but is probably unrelated to your problem) – Randy Morris Apr 14 '11 at 21:21
  • Well, [here's my .gitmodules](http://pastebin.com/dM69jyfu), [here's my `git status`](http://pastebin.com/SHX0HeKp), and [here's my `git submodule foreach git status`](http://pastebin.com/gspDbb5p). – mattalxndr Apr 14 '11 at 22:24
  • @mattalexx - did you commit your changes to `.gitmodules`? – Randy Morris Apr 14 '11 at 22:35
  • @mattalexx - You have a leading `.` before your submodule and path, try removing that. – Randy Morris Apr 15 '11 at 00:09
  • @Randy You mean in `~/.gitmodules`? But the name of the vim dir is `~/.vim`, not `~/vim`. – mattalxndr Apr 15 '11 at 00:32
  • @mattalexx - Doh, sorry. I keep my vim config elsewhere. Not sure what I was thinking. I've run out of ideas unfortunately. Git version? – Randy Morris Apr 15 '11 at 00:36
  • @mattalexx: `submodule.*.ignore` and `git status --ignore-submodule=…` arrived in Git 1.7.2. Try upgrading. – Chris Johnsen May 05 '11 at 18:05
  • @mattalexx You need to upgrade your git, then ignore = untracked will work. – michaeltwofish May 30 '11 at 05:24
  • Any way to supply `ignore=untracked` while adding a git submodule ? – Yugal Jindle Nov 20 '13 at 07:47
7

Randy's answer works best for me. A one liner I use when I want to add the ignore = untracked option to a lot of submodules is:

for s in `git submodule  --quiet foreach 'echo $name'` ; do git config submodule.$s.ignore untracked ; done
zarkdav
  • 679
  • 5
  • 11
  • This command adds the configuration line to .git/config file instead of the .gitmodules file. You need to use `git config -f .gitmodules ...` to modify the correct file. Although even that seems not to work for me. – Marcin K Apr 09 '18 at 04:27
  • To get this to work I had to `git submodule init` and `git submodule update`, than the update took effect – Marcin K Apr 09 '18 at 04:39
4

I have this line i my .git/config:

[status]
   showUntrackedFiles = no

And now every time i run git status untracked files are not displayed. This also speeds up things a bit since git does not check every single file in directory but only those existing in repository.

For more info go to http://git-scm.com/docs/git-config and go to status.showUntrackedFiles.

Edit: Forgot to mention that I also have submodules in bundle directory and I add mentioned option to top-most repository config.

devemouse
  • 5,302
  • 5
  • 22
  • 22