bronson / vim-update-bundles

Use Pathogen and Git to manage your Vim plugins.
91 stars 13 forks source link

Use 'ignore = dirty' in .gitmodules entries #32

Open peterhost opened 12 years ago

peterhost commented 12 years ago

This is an excellent tool I use on a day to day basis on many different computers.

I have only one (tiny wheenie) request :

When using submodules for Vim plugins, we often encounter the situation when the submodule tree becomes dirty adding modified/untraked files to the git status output in the main repo (when building helptags or for ex., or Commant-T Plugin which needs a ruby extension to be rebuilt).

I'm not a rubyist myself but it seems it's "a matter of" (big quotes) adding an ignore = dirty entry in .gitmodules for each submodule as mentionned here

this should be around line 153-164 of the vim-update-bundle main script

def clone_bundle config, dir, url, tagstr, log
  if in_submodule_root(dir) { |mod|
    puts "adding submodule #{dir} from #{url}#{tagstr}"
    git :submodule, :add, url, mod
  }
  else
    puts "cloning #{dir} from #{url}#{tagstr}"
    git :clone, url, dir
  end
  Dir.chdir(dir) { print_log_entry log, 'Add', dir, describe_head, "#{url}#{tagstr}" }
  $bundles_added += 1
end
bronson commented 12 years ago

Interesting idea. Happy to make the change but I worry people might be unpleasantly surprised if they make changes that are quietly ignored.

It's easy to do if you think it helps people more than it might hurt.

peterhost commented 12 years ago

You are right, I guess. Although it's not good practice to modify files directly in a cloned submodule, not showing untracked/unstaged changes might confuse new git users. Let's keep it simple then, as the tool does an excellent job as is.

I personally modify my .gitmodules et .git/config to get rid of the annoying messages. Maybe include it as a command line switch ?