[FOLIO-397] Document how to update git submodules Created: 30/Nov/16  Updated: 12/Nov/18  Resolved: 06/Dec/16

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P3
Reporter: David Crossley Assignee: David Crossley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 6 hours, 25 minutes
Original estimate: Not Specified

Issue links:
Relates
relates to FOLIO-366 Commence a new document to assist wit... In Progress
Sprint:

 Description   

Some FOLIO repositories utilize "git submodules" for sections of common code. Need to explain how to update such.

For example (with DMOD-75) each mod-* module and ram-module-builder include the "raml" repository as a git submodule as its "./raml-util" directory.



 Comments   
Comment by David Crossley [ 30/Nov/16 ]

Note that when originally cloning a repository, use 'git clone --recursive ...'
Some git clients do not. If you then have an empty "raml-util" directory, then do 'git submodule update --init'.

Comment by David Crossley [ 30/Nov/16 ]

Thereafter updating that submodule is deliberately not automated, so that we can ensure a stable build when we git checkout in the future.

So when an update is needed to be committed, do this:

cd mod-configuration (for example)
git submodule foreach 'git checkout master && git pull origin master'
git commit ...

Comment by David Crossley [ 30/Nov/16 ]

Now when people update their local checkout, then some git clients do not automatically update the submodules. So they need to follow with 'git submodule update'

This part can be automated with client-side git hooks.

Create the following two shell scripts:

mod-configuration/.git/hooks/post-checkout
mod-configuration/.git/hooks/post-merge

using this content:

#!/bin/sh
git submodule update

and make them executable: 'chmod +x post-checkout post-merge'

Now subsequent updates will also update the submodules to their declared revision.

Comment by David Crossley [ 30/Nov/16 ]

Need to add such documentation at dev.folio.org/doc/setup ( FOLIO-366 In Progress )

Comment by David Crossley [ 01/Dec/16 ]

See the Discuss topic:
https://discuss.folio.org/t/now-using-git-submodules-for-common-set-of-raml-files/417

Comment by David Crossley [ 06/Dec/16 ]

Added to http://dev.folio.org/doc/setup#update-git-submodules

Generated at Thu Feb 08 23:05:28 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.