From: Orgad Shaneh Date: Mon, 24 Sep 2012 19:16:45 GMT Subject: Re: [PATCH] commit: configure submodules Message-ID: In-Reply-To: <7vy5jzxmts.fsf@alter.siamese.dyndns.org> On Mon, Sep 24, 2012 at 9:06 PM, Junio C Hamano wrote: > Orgad Shaneh writes: > >> That is not correct. git-config is ignored as well for commit. > > What do you mean? As far as I can tell, if you have > > [submodule "var"] > path = var > ignore = dirty > > in $GIT_DIR/config, a work-tree-dirty submodule "var" is not > reported by "git status" and "git commit" without your patch, and > your patch does not seem to break that. The only difference your > patch makes is that if you had the above three-line block in > the .gitmodules file and not in $GIT_DIR/config, "git status" > ignored the dirtyness in the working tree, but "git commit" did > notice and report it. > > What am I missing? > > I have: [submodule "mod"] url = [...] ignore = dirty in .git/config, and I removed the ignore part from .gitmodules to be even. I made a change inside mod, git status doesn't report its dirtiness, while git commit does. git status: # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: foo # # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: .gitmodules # git commit: # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: foo # # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # (commit or discard the untracked or modified content in submodules) # # modified: .gitmodules # modified: mod (modified content) # Now I get it! That's because I don't have submodule.mod.path! config_name_for_path only gets initialized if path exists. Apparently git submodule init doesn't configure 'path', so it stays uninitialized. - Orgad