[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Avoiding a git-checkout failure
From: |
Greg Chicares |
Subject: |
[lmi] Avoiding a git-checkout failure |
Date: |
Tue, 28 Jul 2020 12:51:49 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
Vadim--On a machine in the office, yesterday we observed:
[here, PWD is /srv/cache_for_lmi/vcs/wxWidgets]
git checkout "$wx_commit_sha"
+ git checkout 6cdaedd42ba59331b3dc4ead50e0bac76ae14c19
error: Your local changes to the following files would be overwritten by
checkout:
.gitignore
.mailmap
.travis.yml
CMakeLists.txt
Makefile.in
[...snip long list...]
build/msw/wx_vc8_wxtiff.vcproj
build/msw/wx_vc8_wxzlib.vcproj
build/msw/wx_vc8_xml.vcproj
build/msw/wx_vc8_xrc.vc
Please move or remove them before you switch branches.
Aborting
and a similar failure with wxPdfDoc.
I'd guess this means that 'configure' had been run in this cache
directory at some time, perhaps years ago.
The patch below gets us past these failures, but before applying
it I'd like to ask whether you have any objection. Any local
modifications in our cache directory are sure to be unintentional.
OTOH, wx developers regularly have local modifications, but most
likely not in a /srv/cache_for_lmi/ directory.
I suppose we could do this instead:
git stash --all
but running the script would still make silent changes in any
local work, so I'm not sure that's any better.
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
diff --git a/install_wx.sh b/install_wx.sh
index 3b0af548..f858d533 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -75,6 +75,8 @@ then
git fetch origin
fi
+# Reset in case git-checkout would fail.
+git reset --hard
git checkout "$wx_commit_sha"
# Get any new submodules that may have been added, even if nested.
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
index 11068cdc..37867de9 100755
--- a/install_wxpdfdoc.sh
+++ b/install_wxpdfdoc.sh
@@ -75,6 +75,8 @@ then
git fetch origin
fi
+# Reset in case git-checkout would fail.
+git reset --hard
git checkout "$wxpdfdoc_commit_sha"
build_type=$("$proxy_wxpdfdoc_dir"/admin/build-aux/config.guess)
--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8---
- [lmi] Avoiding a git-checkout failure,
Greg Chicares <=