[racket-dev] Using `git submodule` vs. `git pull --ff-only upstream master`

From: Greg Hendershott (greghendershott at gmail.com)
Date: Fri Sep 20 14:30:30 EDT 2013

I build Racket while keeping my forked repo's `master` branch an
exact, fast-forwardable copy of PLT's remote upstream `master`. [1]

This has worked fine building Racket on Linux, and continues to do so.

But on OS X, I need to follow these instructions from INSTALL.TXT, wrt
the pkg re-org:

>>>
On Mac OS X and Windows, you'll need native-library packages in the
"native-pkgs" directory. In the git repostory, "native-pkgs" is a git
submodule, so you'll need
   git submodule init
   git submodule update
to get it set up.
<<<

After I do so, the resulting build works great.

However it introduces a change:

>>>
greg at mbp in ~/src/plt/racket on master*
$ git diff
diff --git a/native-pkgs b/native-pkgs
index f367c0c..f8c8984 160000
--- a/native-pkgs
+++ b/native-pkgs
@@ -1 +1 @@
-Subproject commit f367c0c4b05b91401d68b0180b416d616b31720d
+Subproject commit f8c8984ebe8a442d474558dced0eb824cbb24772
<<<

If I commit this, my master wouldn't be a FF copy anymore (AFIK). So I don't.

But as a result, if I switch to a topic branch without committing
(normally a no-no), it's a bit weird:

>>>
greg at mbp in ~/src/plt/racket on master*
$ git checkout imap-append-flags
warning: unable to rmdir native-pkgs: Directory not empty
Switched to branch 'imap-append-flags'
<<<

After switching back to master, everything seems OK:

>>>
greg at mbp in ~/src/plt/racket on imap-append-flags*
$ git checkout master
M native-pkgs
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 771 commits.
<<<

Is this -- the warning about native-pkgs -- something I should just
learn to ignore and treat as the new normal?


[1]: http://www.greghendershott.com/2013/04/a-guide-for-infrequent-contributors-to-racket.html

Posted on the dev mailing list.