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

Git Submodule hooks someone else may find of use

From
Tim Harper <timcharper@gmail.com>
Date
Jul 2, 2009, 15:20 UTC
Message-ID
<e1a5e9a00907020820i34fb3127r90f29d06619fe64e@mail.gmail.com>

A while ago I started a thread discussing my desires to have submodules automatically update when I switch branches or pull. This I desired to occur only if my submodule revision conformed with the pointer recorded in the superproject's previous HEAD. In other words, if my submodule showed as "modified", and I switch branches, I would desire that this "modified" state persist exactly the same way an uncommitted change would.

I've created a local git hook to support this behavior. If it interests you, you may find it here, under 'git-post-checkout-submodules'.

http://github.com/timcharper/git-helpers/tree/master
Installation instructions are found at the top of the script.
Feedback welcome.
Tim
Message 1 of 1 in “Git Submodule hooks someone else may find of use”
  1. Tim HarperJul 2, 2009

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.