Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>That should work, as a <strong><code>post-update hook</code> on the <em>parent</em> repo</strong>:<br> You would need to monitor the <code>.gitmodules</code> file for any changes, in order to detect any changes in that file (indicating that another clone of your parent repo has changed a submodule and committed the new reference in the parent repo).<br> Then you can:</p> <ul> <li>detect which submodules has changed</li> <li>decide if you want to bring your submodules up-to-date (<code>git submodule update --recursive</code>)</li> <li>recompile the relevant submodules</li> </ul> <p>But that supposes a clone of the parent repo has been modified to reference new commits of your submodules.</p> <p>If you submodules are updated independently of any parent repo, then the same <code>post-update</code> hook (still on the parent repo), on a checkout/update of the parent repo, needs to:</p> <ul> <li>go in each submodules and perform a fetch</li> <li>check if the fetch introduces any new commits</li> <li>decide if you want to bring your submodules up-to-date, this time by pulling the changes from the submodules</li> <li>go back in the parent repo and commit, in order to register the new SHA1 of the changes submodules</li> <li>recompiles the ones that needed a <code>git pull</code> (i.e. that has changed)</li> </ul> <p>You could setup post-update hook on each of the submodules, but the above approach scales better when you add or remove submodules from your parent repo, as it centralizes the detection process in one place (the <code>post-update</code> hook of the parent repo).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload