Re: [RFC PATCH 02/10] submodule: factor out a config_gitmodules_set function
From: Antonio Ospite <hidden>
Date: 2018-06-20 18:42:00
On Mon, 14 May 2018 18:20:21 -0700 Stefan Beller [off-list ref] wrote:
On Mon, May 14, 2018 at 3:58 AM, Antonio Ospite [off-list ref] wrote:quoted
Introduce a new config_gitmodules_set function to write config values to the .gitmodules file. This is in preparation for a future change which will use the function to write to the .gitmodules file in a more controlled way instead of using "git config -f .gitmodules". Signed-off-by: Antonio Ospite <redacted> --- Not sure about the name, and maybe it can go in config.c for symmetry with config_from_gitmodules?What is the function about (in the end state and now) ? is it more of a * configure_submodules_config() which would convey it is a generic function to configure submodules (i.e. it may not even write to *the* .gitmodules file but somewhere else, such as a helper ref) This doesn't sound like it as we make use of the function in update_path_in_gitmodules() that is used from git-mv, which would want to ensure that the specific .gitmodules file is changed. * gitmodules_file_set() that focuses on the specific file that we want to modify? * ... Let's continue reading the series to see the end state for a good name.
OK, that helped to clarify one point: eventually there will be some asymmetry between reading the submodule config and writing it. 1. reading will be either form .gitmodules or HEAD:.gitmodules; 2. writing will be only to .gitmodules. I'll try to consider that when naming the functions. If a more generic mechanism to write the submodules configuration is added in the future (e.g. the special ref you were mentioning) the functions can always be renamed accordingly. Thanks, Antonio -- Antonio Ospite https://ao2.it https://twitter.com/ao2it A: Because it messes up the order in which people normally read text. See http://en.wikipedia.org/wiki/Posting_style Q: Why is top-posting such a bad thing?