git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Orgad Shaneh <orgads@gmail.com>
Cc: git@vger.kernel.org, Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH] commit: configure submodules
Date: Sun, 23 Sep 2012 01:37:34 -0700	[thread overview]
Message-ID: <7vr4pt16ep.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1348385867-17359-1-git-send-email-orgads@gmail.com> (Orgad Shaneh's message of "Sun, 23 Sep 2012 09:37:47 +0200")

Orgad Shaneh <orgads@gmail.com> writes:

> As reported on the mailing list[1], ignore submodule config is not
> respected on commit.
>
> [1] http://git.661346.n2.nabble.com/submodule-ignore-is-not-respected-on-commit-td7539238.html
>
> Signed-off-by: Orgad Shaneh <orgads@gmail.com>
> ---

Thanks.

Please do not force people to go to external website like that while
reading the "git log" output.  You could have just said

	"git status" does not list a submodule with uncommitted
	working tree files as modified when "submodule.$name.ignore"
	configuration is set to "dirty", but "git commit" forgets
        to take this configuration variable into account.

or something.  It would also be good to say "I reported it earlier
in this message" with the URL _after_ the three-dash line.

I see Jens added with 302ad7a (Submodules: Use "ignore" settings
from .gitmodules too for diff and status, 2010-08-06) the call to
gitmodules_config() to "git status" and "git diff" family, but I
suspect that was a huge mistake.  Once a submodule is initialized
with "submodule init", the default set of configuration should be
copied to the user's $GIT_DIR/config and subsequent run-time
invocation should read $GIT_DIR/config and $GIT_DIR/config alone, to
honor user's customization.

Instead, I think git_commit_config() and git_status_config() should
call submodule_config() function to read submodule.$name.ignore not
from .gitmodules file but from $GIT_DIR/config.

Jens, what do you think?  I see no reason for anybody other than
"submodule init" to call gitmodules_config() that reads from the
in-tree .gitmodules file.

>  builtin/commit.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/builtin/commit.c b/builtin/commit.c
> index 62028e7..7a83cae 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -1452,6 +1452,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>  		usage_with_options(builtin_commit_usage, builtin_commit_options);
>  
>  	wt_status_prepare(&s);
> +	gitmodules_config();
>  	git_config(git_commit_config, &s);
>  	determine_whence(&s);
>  	s.colopts = 0;

  reply	other threads:[~2012-09-23  8:38 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 [this message]
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
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=7vr4pt16ep.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --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).