On Mon, 10 Dec 2018, Stefan Beller wrote: > Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx> > --- > > > So you are proposing a variable like submodule.update > > [...] > > Glad to hear that. Not sure though I would know where to stick my > > nose to figure out what to change. ;-) > The update_module is computed via the submodule--helpers > update-module-mode command, which is a small wrapper > around determine_submodule_update_strategy() > which you already touched in the other patch that makes > --reset-hard another mode. > This contains code and tests, but we'd need some docs as well. > I am not sure about this patch as it allows for easier experimentation > with submodules (e.g. "git config submodule.update '!git reset --hard'" > sounds like what you're trying to get) ;-) it was indeed one of the original approaches I considered instead of having "update --reset-hard"... > and using them, but as discussed > below this might be too much convenience already and we'd rather want to > have it properly integrated into the real commands. indeed, having "update --reset-hard" provides necessary to me convenience for my use cases. Motivation behind submodule.update was primarily to allow for heterogeneous (but still simple to define) strategies, where for some subproject I could just define submodule.update to be "reset-hard" (I do not expect my local commits matter) and in the others -- "merge" (I carry my changes on top). But again, I must confess, that either I forgot or just do not see a clear use-case/demand for submodule.update config myself any longer, besides providing a potentially useful default over submodule.MODULE.update config. > > Well, not sure... In the long run, if UX is to be tuned up, I wonder if > > it would be more worthwhile to look toward making all those git commands > > (git merge, git checkout, git rebase, ..., git revert, git cherry-pick) > > support --recurse-submodules with a consistent with the non-recursive > > operation by default behavior > That is the end goal, very much. > > (e.g. not introducing detached HEADs or > > controlling that via a set of additional options where needed). > As with the discussion of the submodule.repoLike option (the patch I > referenced in the other discussion), this is tricky to get the right > behavior, so it takes some more time to do. > Also what is right for a "git merge --recursive" might be totally different > from a "git submodule update --merge" as the former is not centered around > submodules but merging, such that a sensible default would be expected, > whereas the "submodule update" is allowed to have a rough edge. Probably I need to try "submodules update --merge" to see what is that rough edge which makes it different from the potential "merge --recurse-submodules", or is it easy to describe? ;-) I wonder if may be instead of pestering you about this config one, I should ask about pointers on how to accomplish "revert --recurse-submodules" or where to poke to make it possible to clone recursively from http://datasets.datalad.org/ where we do not place submodules all under the very top /.git/modules ;-) -- Yaroslav O. Halchenko Center for Open Neuroscience http://centerforopenneuroscience.org Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755 Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419 WWW: http://www.linkedin.com/in/yarik