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

Re: [RFC/PATCH] Implement poor-man's submodule support in pre-commit hook

From
Junio C Hamano <junkio@cox.net>
Date
Dec 21, 2006, 08:49 UTC
Message-ID
<7v7iwleiqb.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200612210839.35980.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 11 quoted lines
>> As you fix them and enhance the support, I suspect you would
>> want a separate command to manage .gitmodule file and submodules
>> referenced by it.  I think it would be better to keep the patch
>> to the template to the minimum (for example, run "git submodule
>> update" if there is .gitmodules file at the toplevel), and
>> implement the body of the processing in "git-submodule.sh", or
>> something like that.
>
> That's an interesting idea.  I was thinking that git-commit
> itself would have been the final target; but I certainly don't
> have any problem with a separate command.
I do not think the commit command would be the "final" one.

When you have a loosely coupled subproject, sometimes you might want to check out subprojects recursively, so you would also want "checkout" action to "git submodule", which might hook into "git checkout" just like your patch hooked into "git commit". Similarly your future versions certainly would want to hook into "git fetch/pull".

Just like some peoples' workflow avoid "git pull" but do "git fetch" and "git merge" as separate steps, some people may want to disable the above "hooks", and prefer using "git submodule" from the command line as a separate step, especially if they want very loose coupling.

Previous: Andy Parkins
Message 11 of 11 in “Implement poor-man's submodule support in pre-commit hook”
  1. Implement poor-man's submodule support in pre-commit hookAndy Parkins, Dec 20, 2006
  2. Andy ParkinsDec 20, 2006
  3. Brian GernhardtDec 20, 2006
  4. Jakub NarebskiDec 20, 2006
  5. Andreas EricssonDec 20, 2006
  6. [BUG] git --git-dir dies with bus errorBrian Gernhardt, Dec 20, 2006
  7. Jakub NarebskiDec 20, 2006
  8. Andy ParkinsDec 20, 2006
  9. Junio C HamanoDec 20, 2006
  10. Andy ParkinsDec 21, 2006
  11. Junio C HamanoDec 21, 2006

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.