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

Re: [PATCH v2 0/6] Restrict the usage of config_from_gitmodules to submodule-config

From
BWBrandon Williams <bmwill@google.com>
Date
Jun 26, 2018, 17:05 UTC
Message-ID
<20180626170529.GF19910@google.com>
In-Reply-To
<20180626104710.9859-1-ao2@ao2.it>
On 06/26, Antonio Ospite wrote:
Show 33 quoted lines
> Hi,
> 
> this is version 2 of the series from
> https://public-inbox.org/git/20180622162656.19338-1-ao2@ao2.it/
> 
> The .gitmodules file is not meant for arbitrary configuration, it should
> be used only for submodules properties.
> 
> Plus, arbitrary git configuration should not be distributed with the
> repository, and .gitmodules might be a possible "vector" for that.
> 
> The series tries to alleviate both these issues by moving the
> 'config_from_gitmodules' function from config.[ch] to submodule-config.c
> and making it private.
> 
> This should discourage future code from using the function with
> arbitrary config callbacks which might turn .gitmodules into a mechanism
> to load arbitrary configuration stored in the repository.
> 
> Backward compatibility exceptions to the rules above are handled by
> ad-hoc helpers.
> 
> Finally (in patch 6) some duplication is removed by using
> 'config_from_gitmodules' to load the submodules configuration in
> 'repo_read_gitmodules'.
> 
> Changes since v1:
>   * Remove an extra space before an arrow operator in patch 2
>   * Fix a typo in the commit message of patch 3: s/fetchobjs/fetchjobs
>   * Add a note in the commit message of patch 6 about checking the
>     worktree before loading .gitmodules
>   * Drop patch 7, it was meant as a cleanup but resulted in parsing the
>     .gitmodules file twice
Thanks for making these changes, this version looks good to me!
-- 
Brandon Williams
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 14 in “Restrict the usage of config_from_gitmodules to submodule-config”
  1. 0/6 Restrict the usage of config_from_gitmodules to submodule-configAntonio Ospite, Jun 26, 2018
  2. 1/6 config: move config_from_gitmodules to submodule-config.cAntonio Ospite, Jun 26, 2018
  3. 6/6 submodule-config: reuse config_from_gitmodules in repo_read_gitmodulesAntonio Ospite, Jun 26, 2018
  4. 3/6 submodule-config: add helper to get 'update-clone' config from .gitmodulesAntonio Ospite, Jun 26, 2018
  5. 5/6 submodule-config: pass repository as argument to config_from_gitmodulesAntonio Ospite, Jun 26, 2018
  6. Junio C HamanoJun 26, 2018
  7. Antonio OspiteJun 26, 2018
  8. 2/6 submodule-config: add helper function to get 'fetch' config from .gitmodulesAntonio Ospite, Jun 26, 2018
  9. Junio C HamanoJun 26, 2018
  10. Antonio OspiteJun 26, 2018
  11. 4/6 submodule-config: make 'config_from_gitmodules' privateAntonio Ospite, Jun 26, 2018
  12. Junio C HamanoJun 26, 2018
  13. Brandon WilliamsJun 26, 2018
  14. Junio C HamanoJun 26, 2018

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.