From 25b2e6c710fceed8c95bbf175e7b2beebec0ea31 Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Tue, 16 Jun 2015 10:28:29 -0400 Subject: [PATCH] update link_git_modules and describe in README --- README.md | 15 ++++++++++++++- link_git_modules | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dda099..8d2e04a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,19 @@ Additionally, I wanted to try to start encouraging some "better practices" is a complex system, so you're responsible for figuring out how to properly document your code. +5. Simplify `git` a touch -- In my larger projects, I make heavy use of + git modules. One project may make use of 20-30 modules, which are + designed to be re-usable across other projects. I found that I was + spending too much time making sure that I had the latest version + of a module checked out, so I created two scripts to help me keep + my modules in line: `link_git_modules` and `update_git_modules`. + You run the `link` script once to ensure that your modules are properly + set up, and can then run the `update` script at any time to be sure + you've pulled the latest version. One advantage of this is that your + modules are set to a branch, rather than just a detached commit. It + may or may not work for your needs, but it saves me a bunch of time + and headache. + [tdd]: https://en.wikipedia.org/wiki/Test-driven_development [cmake]: http://www.cmake.org/ @@ -117,4 +130,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/link_git_modules b/link_git_modules index deb7cd1..e08639c 100755 --- a/link_git_modules +++ b/link_git_modules @@ -1,5 +1,9 @@ #!/bin/sh +git submodule init + +git submodule update + git submodule foreach git branch --set-upstream master origin/master git submodule foreach git checkout master -- 2.40.0