Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
peterhost opened this issue Dec 17, 2011 · 2 comments
Open

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

peterhost opened this issue Dec 17, 2011 · 2 comments

Comments

@peterhost
Copy link

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
Copy link
Owner

bronson commented Jan 10, 2012

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
Copy link
Author

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 ?

david-ragazzi pushed a commit to david-ragazzi/nupic that referenced this issue Apr 10, 2014
`ignore = dirty` option avoids that git include the word -dirty in the end of the submodule SHA when files in a submodule folder are changed.. If these changes aren't reverted, it's impossible synchronize nupic repo with a "dirty" submodule.. 

As we should pull PRs directly from `nupic.core` repo cloned to our machine, not from its `/nta` subfolder in `nupic`, I think is simpler ignore the changes were in `/nta` and so avoid typing commands to ignore manually these changes..

I saw several developers that recommend this option:

http://stackoverflow.com/questions/3240881/git-can-i-suppress-listing-of-modified-content-dirty-submodule-entries-in-sta

http://www.nils-haldenwang.de/frameworks-and-tools/git/how-to-ignore-changes-in-git-submodules

bronson/vim-update-bundles#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants