git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] commit: configure submodules

From
Orgad Shaneh <orgads@gmail.com>
Date
Sep 24, 2012, 18:49 UTC
Message-ID
<CAGHpTB+F3=mW9m3ESQe1wAkLzSBcp+5Kgw1Kb-D-rk2T1q_-iw@mail.gmail.com>
In-Reply-To
<7vlifzz2vo.fsf@alter.siamese.dyndns.org>
On Mon, Sep 24, 2012 at 8:34 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 61 quoted lines
>
> Jens Lehmann <Jens.Lehmann@web.de> writes:
>
> > Am 24.09.2012 18:27, schrieb Junio C Hamano:
> >> Junio C Hamano <gitster@pobox.com> writes:
> >>> In any case, the log message I suggested in the review needs to be
> >>> updated in the reroll to make it clear that this is about reading
> >>> from .gitmodules, not "configuration".  AFAICS, gitmodule_config()
> >>> does not even read from $GIT_DIR/config, right?
> >>
> >> OK.  gitmodule_config() does not read $GIT_DIR/config, but
> >> cmd_status() and cmd_commit() call git_diff_basic_config() that is
> >> called from git_diff_ui_config() to read submodule.$name.ignore from
> >> it.  So Orgad's patch is _only_ about submodule.$name.ignore that is
> >> in in-tree .gitmodule; the log message shouldn't mention "config",
> >> as setting configuration variables work for both status and commit
> >> just fine.
> >
> > Yes, I was just checking that call path too to make sure the user
> > settings from $GIT_DIR/config really override those found in
> > .gitmodules. And of course you are right, while the change to the
> > code is sane the commit message still needs some work.
>
> Here is what I tentatively queued on 'pu' (not pushed out yet).
>
> -- >8 --
> From: Orgad Shaneh <orgads@gmail.com>
> Date: Sun, 23 Sep 2012 09:37:47 +0200
> Subject: [PATCH] commit: pay attention to submodule.$name.ignore in
>  .gitmodules
>
> "git status" does not list a submodule with uncommitted working tree
> files as modified when "submodule.$name.ignore" is set to "dirty" in
> in-tree ".gitmodules" file.  Both status and commit honor the setting
> in $GIT_DIR/config, but "commit" does not pick it up from .gitmodules,
> which is inconsistent.
>
> Teach "git commit" to pay attention to the setting in .gitmodules as
> well.
>
> Signed-off-by: Orgad Shaneh <orgads@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  builtin/commit.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/builtin/commit.c b/builtin/commit.c
> index 66fdd22..3cb1ef7 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -1256,6 +1256,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>         struct wt_status s;
>
>         wt_status_prepare(&s);
> +       gitmodules_config();
>         git_config(git_commit_config, &s);
>         in_merge = file_exists(git_path("MERGE_HEAD"));
>         s.in_merge = in_merge;
> --
> 1.7.12.1.441.g794a63b
>

That is not correct. git-config is ignored as well for commit. Maybe another fix is needed?

- Orgad
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 14 in “commit: configure submodules”
  1. commit: configure submodulesOrgad Shaneh, Sep 23, 2012
  2. Junio C HamanoSep 23, 2012
  3. Jens LehmannSep 23, 2012
  4. Junio C HamanoSep 24, 2012
  5. Junio C HamanoSep 24, 2012
  6. Jens LehmannSep 24, 2012
  7. Junio C HamanoSep 24, 2012
  8. Orgad ShanehSep 24, 2012
  9. Junio C HamanoSep 24, 2012
  10. Orgad ShanehSep 24, 2012
  11. Jens LehmannSep 24, 2012
  12. Orgad ShanehSep 24, 2012
  13. Jens LehmannSep 24, 2012
  14. Junio C HamanoSep 24, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.