<p>Marc Jones has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22857">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/gitconfig: Make gitconfig a bash script<br><br>The gitconfig target has a few bashisms and would fail<br>silently on systems that use a POSIX standard sh (like Ubuntu dash).<br><br>Remove the code from the makefile and put it in a bash script that<br>is called by the gitconfig target.<br><br>Change-Id: I3bc8cf688a3ad211b57c8ca0e6b1e86c82dc6a37<br>Signed-off-by: Marc Jones <marcj303@gmail.com><br>---<br>M Makefile.inc<br>A util/gitconfig/gitconfig.sh<br>2 files changed, 30 insertions(+), 28 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/22857/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/Makefile.inc b/Makefile.inc<br>index f93b4bd..413f7ad 100644<br>--- a/Makefile.inc<br>+++ b/Makefile.inc<br>@@ -570,34 +570,7 @@<br>   dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF<br> <br> gitconfig:<br>-     [ -d .git ]<br>-  mkdir -p .git/hooks<br>-  for hook in commit-msg pre-commit ; do                       \<br>-               if [ util/gitconfig/$$hook -nt .git/hooks/$$hook -o  \<br>-               ! -x .git/hooks/$$hook ]; then                       \<br>-                       sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/$$hook > .git/hooks/$$hook;  \<br>-                       chmod +x .git/hooks/$$hook;                  \<br>-               fi;                                                  \<br>-       done<br>- # Now set up thehooks for 3rdparty/<br>-  for hooks in .git/modules/{3rdparty/blobs,libhwbase,libgfxinit}/hooks; do                       \<br>-            if [ -d $$hooks -a                                                                      \<br>-            \( util/gitconfig/commit-msg -nt $$hooks/commit-msg -o                                  \<br>-                    ! -x $$hooks/commit-msg \) ]; then                                              \<br>-                    sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/commit-msg > $$hooks/commit-msg;        \<br>-                    chmod +x $$hooks/commit-msg;                                                    \<br>-            fi                                                                                      \<br>-    done<br>- for d in 3rdparty/{blobs,libhwbase,libgfxinit}; do                      \<br>-            if [ -d $$d ]; then                                             \<br>-                    (cd $$d;                                                \<br>-                     git config remote.origin.push HEAD:refs/for/master);   \<br>-            fi;                                                             \<br>-    done<br>- git config remote.origin.push HEAD:refs/for/master<br>-   git config alias.sup '!git submodule update --remote --rebase && git submodule update --init --checkout'<br>-     git config alias.sup-destroy '!git submodule deinit --force "$$(git rev-parse --show-toplevel)"; git submodule init && git submodule update --checkout'<br>-    (git config --includes user.name >/dev/null && git config --includes user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email@example.com\n'; exit 1)<br>+    util/gitconfig/gitconfig.sh<br> <br> include util/crossgcc/Makefile.inc<br> <br>diff --git a/util/gitconfig/gitconfig.sh b/util/gitconfig/gitconfig.sh<br>new file mode 100755<br>index 0000000..84587f1<br>--- /dev/null<br>+++ b/util/gitconfig/gitconfig.sh<br>@@ -0,0 +1,29 @@<br>+#!/bin/bash<br>+[ -d .git ]<br>+mkdir -p .git/hooks<br>+for hook in commit-msg pre-commit ; do                       \<br>+  if [ util/gitconfig/$hook -nt .git/hooks/$hook -o  \<br>+ ! -x .git/hooks/$hook ]; then                        \<br>+               sed -e "s,%MAKE%,remake,g" util/gitconfig/$hook > .git/hooks/$hook;  \<br>+          chmod +x .git/hooks/$hook;                   \<br>+       fi;                                                  \<br>+done<br>+# Now set up the hooks for 3rdparty/<br>+for hooks in .git/modules/{3rdparty/blobs,libhwbase,libgfxinit}/hooks; do                        \<br>+    if [ -d $hooks -a                                                                       \<br>+    \( util/gitconfig/commit-msg -nt $hooks/commit-msg -o                                   \<br>+            ! -x $hooks/commit-msg \) ]; then                                               \<br>+            sed -e "s,%MAKE%,remake,g" util/gitconfig/commit-msg > $hooks/commit-msg;  \<br>+            chmod +x $hooks/commit-msg;                                                     \<br>+    fi                                                                                      \<br>+done<br>+for d in 3rdparty/{blobs,libhwbase,libgfxinit}; do                   \<br>+    if [ -d $d ]; then                                              \<br>+            (cd $d;                                         \<br>+             git config remote.origin.push HEAD:refs/for/master);   \<br>+    fi;                                                             \<br>+done<br>+git config remote.origin.push HEAD:refs/for/master<br>+git config alias.sup '!git submodule update --remote --rebase && git submodule update --init --checkout'<br>+git config alias.sup-destroy '!git submodule deinit --force "$(git rev-parse --show-toplevel)"; git submodule init && git submodule update --checkout'<br>+(git config --includes user.name >/dev/null && git config --includes user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email@example.com\n'; exit 1)<br></pre><p>To view, visit <a href="https://review.coreboot.org/22857">change 22857</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22857"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3bc8cf688a3ad211b57c8ca0e6b1e86c82dc6a37 </div>
<div style="display:none"> Gerrit-Change-Number: 22857 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marc Jones <marc@marcjonesconsulting.com> </div>