git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Orgad Shaneh <orgads@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] commit: configure submodules
Date: Mon, 24 Sep 2012 22:10:55 +0200	[thread overview]
Message-ID: <5060BE4F.2040506@web.de> (raw)
In-Reply-To: <CAGHpTBLs2tgUunDtFMhw7QMiuB2oXBtQJLKpLckhEyDp7Zr+Qg@mail.gmail.com>

Am 24.09.2012 21:59, schrieb Orgad Shaneh:
> On Mon, Sep 24, 2012 at 9:56 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
>> Am 24.09.2012 21:16, schrieb Orgad Shaneh:
>>> On Mon, Sep 24, 2012 at 9:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>>> Orgad Shaneh <orgads@gmail.com> 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 <file>..." to unstage)
>>> #
>>> #       modified:   foo
>>> #
>>> # Changes not staged for commit:
>>> #   (use "git add <file>..." to update what will be committed)
>>> #   (use "git checkout -- <file>..." 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 <file>..." to unstage)
>>> #
>>> #       modified:   foo
>>> #
>>> # Changes not staged for commit:
>>> #   (use "git add <file>..." to update what will be committed)
>>> #   (use "git checkout -- <file>..." 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.
>>
>> But submodule.mod.path should only be set in .gitmodules, not in
>> $GIT_DIR/config. Did you just remove the ignore setting from
>> .gitmodules or the path too?
> 
> Just the ignore, and my patch of course.
> 
> If it is not set in $GIT_DIR/config, then config_name_for_path is not
> initialized, and if it is not initialized, then
> set_diffopt_flags_from_submodule_config does nothing
> (handle_ignore_submodules_arg is not called). That is the main
> problem.

But config_name_for_path can only be set via .gitmodules. It is set in
parse_submodule_config_option() called by submodule_config() which is
called from gitmodules_config() ... but only if .gitmodules doesn't
have a merge conflict.

So either your .gitmodules has a merge conflict or the logic setting
gitmodules_is_unmerged in gitmodules_config() is buggy.

  reply	other threads:[~2012-09-24 20:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-23  7:37 [PATCH] commit: configure submodules Orgad Shaneh
2012-09-23  8:37 ` Junio C Hamano
2012-09-23 18:13   ` Jens Lehmann
2012-09-24  5:57     ` Junio C Hamano
2012-09-24 16:27       ` Junio C Hamano
2012-09-24 18:15         ` Jens Lehmann
2012-09-24 18:34           ` Junio C Hamano
2012-09-24 18:49             ` Orgad Shaneh
2012-09-24 19:06               ` Junio C Hamano
2012-09-24 19:16                 ` Orgad Shaneh
2012-09-24 19:56                   ` Jens Lehmann
2012-09-24 19:59                     ` Orgad Shaneh
2012-09-24 20:10                       ` Jens Lehmann [this message]
2012-09-24 20:36                     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5060BE4F.2040506@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=orgads@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).