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

Re: [PATCH 07/15] submodule: don't rely on overlayed config when setting diffopts

From
Stefan Beller <sbeller@google.com>
Date
Jul 25, 2017, 23:46 UTC
Message-ID
<CAGZ79kZ24eT6kyLE6W8PTQwCy3gJWUaexFCOdQrQbS5tPEAmsg@mail.gmail.com>
In-Reply-To
<20170725213928.125998-8-bmwill@google.com>
On Tue, Jul 25, 2017 at 2:39 PM, Brandon Williams <bmwill@google.com> wrote:
Show 25 quoted lines
> Don't rely on overlaying the repository's config on top of the
> submodule-config, instead query the repository's config directory for
> the ignore field.
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---
>  submodule.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/submodule.c b/submodule.c
> index c5058a4b8..f86b82fbb 100644
> --- a/submodule.c
> +++ b/submodule.c
> @@ -165,8 +165,16 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
>  {
>         const struct submodule *submodule = submodule_from_path(&null_oid, path);
>         if (submodule) {
> -               if (submodule->ignore)
> -                       handle_ignore_submodules_arg(diffopt, submodule->ignore);
> +               const char *ignore;
> +               char *key;
> +
> +               key = xstrfmt("submodule.%s.ignore", submodule->name);
> +               if (repo_config_get_string_const(the_repository, key, &ignore))
> +                       ignore = submodule->ignore;

Unlike the last patch, we have to use a direct lookup here as the alternative is hugely painful.

Show 10 quoted lines
> +               free(key);
> +
> +               if (ignore)
> +                       handle_ignore_submodules_arg(diffopt, ignore);
>                 else if (is_gitmodules_unmerged(&the_index))
>                         DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES);
>         }
> --
> 2.14.0.rc0.400.g1c36432dff-goog
>
Previous: Brandon WilliamsNext: Brandon Williams
Message 27 of 61 in “submodule-config cleanup”
  1. 00/15 submodule-config cleanupBrandon Williams, Jul 25, 2017
  2. 02/15 submodule: don't use submodule_from_nameBrandon Williams, Jul 25, 2017
  3. Stefan BellerJul 25, 2017
  4. Junio C HamanoJul 26, 2017
  5. Jens LehmannJul 30, 2017
  6. Junio C HamanoJul 30, 2017
  7. Stefan BellerJul 31, 2017
  8. Heiko VoigtAug 11, 2017
  9. 04/15 submodule--helper: don't overlay config in remote_submodule_branchBrandon Williams, Jul 25, 2017
  10. Stefan BellerJul 25, 2017
  11. 05/15 submodule--helper: don't overlay config in update-cloneBrandon Williams, Jul 25, 2017
  12. Stefan BellerJul 25, 2017
  13. Brandon WilliamsJul 25, 2017
  14. 08/15 unpack-trees: don't rely on overlayed configBrandon Williams, Jul 25, 2017
  15. 09/15 submodule: remove submodule_config callback routineBrandon Williams, Jul 25, 2017
  16. Junio C HamanoJul 26, 2017
  17. 12/15 submodule-config: move submodule-config functions to submodule-config.cBrandon Williams, Jul 25, 2017
  18. 15/15 submodule: remove gitmodules_configBrandon Williams, Jul 25, 2017
  19. 14/15 unpack-trees: improve loading of .gitmodulesBrandon Williams, Jul 25, 2017
  20. 13/15 submodule-config: lazy-load a repository's .gitmodules fileBrandon Williams, Jul 25, 2017
  21. 11/15 submodule-config: remove support for overlaying repository configBrandon Williams, Jul 25, 2017
  22. 10/15 diff: stop allowing diff to have submodules configured in .git/configBrandon Williams, Jul 25, 2017
  23. 06/15 fetch: don't overlay config with submodule-configBrandon Williams, Jul 25, 2017
  24. Stefan BellerJul 25, 2017
  25. Brandon WilliamsJul 25, 2017
  26. 07/15 submodule: don't rely on overlayed config when setting diffoptsBrandon Williams, Jul 25, 2017
  27. Stefan BellerJul 25, 2017
  28. 01/15 t7411: check configuration parsing errorsBrandon Williams, Jul 25, 2017
  29. Junio C HamanoJul 26, 2017
  30. 03/15 add, reset: ensure submodules can be added or resetBrandon Williams, Jul 25, 2017
  31. Stefan BellerJul 25, 2017
  32. Brandon WilliamsJul 25, 2017
  33. Junio C HamanoJul 26, 2017
  34. Brandon WilliamsJul 31, 2017
  35. 00/15 submodule-config cleanupBrandon Williams, Aug 3, 2017
  36. 03/15 add, reset: ensure submodules can be added or resetBrandon Williams, Aug 3, 2017
  37. 05/15 submodule--helper: don't overlay config in update-cloneBrandon Williams, Aug 3, 2017
  38. 08/15 unpack-trees: don't respect submodule.updateBrandon Williams, Aug 3, 2017
  39. Stefan BellerAug 3, 2017
  40. Junio C HamanoAug 3, 2017
  41. Stefan BellerAug 3, 2017
  42. 07/15 submodule: don't rely on overlayed config when setting diffoptsBrandon Williams, Aug 3, 2017
  43. 09/15 submodule: remove submodule_config callback routineBrandon Williams, Aug 3, 2017
  44. 12/15 submodule-config: move submodule-config functions to submodule-config.cBrandon Williams, Aug 3, 2017
  45. 14/15 unpack-trees: improve loading of .gitmodulesBrandon Williams, Aug 3, 2017
  46. Heiko VoigtAug 11, 2017
  47. 15/15 submodule: remove gitmodules_configBrandon Williams, Aug 3, 2017
  48. 13/15 submodule-config: lazy-load a repository's .gitmodules fileBrandon Williams, Aug 3, 2017
  49. 10/15 diff: stop allowing diff to have submodules configured in .git/configBrandon Williams, Aug 3, 2017
  50. Junio C HamanoAug 3, 2017
  51. Brandon WilliamsAug 4, 2017
  52. 11/15 submodule-config: remove support for overlaying repository configBrandon Williams, Aug 3, 2017
  53. 06/15 fetch: don't overlay config with submodule-configBrandon Williams, Aug 3, 2017
  54. 04/15 submodule--helper: don't overlay config in remote_submodule_branchBrandon Williams, Aug 3, 2017
  55. 02/15 submodule: don't use submodule_from_nameBrandon Williams, Aug 3, 2017
  56. Stefan BellerAug 3, 2017
  57. Brandon WilliamsAug 4, 2017
  58. Heiko VoigtAug 11, 2017
  59. Junio C HamanoAug 3, 2017
  60. 01/15 t7411: check configuration parsing errorsBrandon Williams, Aug 3, 2017
  61. Junio C HamanoAug 3, 2017

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.