[MERGED] osmo-ci[master]: scripts: use 'git checkout -f' instead of 'reset --hard'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Oct 27 23:59:52 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: scripts: use 'git checkout -f' instead of 'reset --hard'
......................................................................


scripts: use 'git checkout -f' instead of 'reset --hard'

'checkout -f' more accurately does what is intended. 'reset' changes the
current branch to some hash, 'checkout -f' force-checkouts another branch.

Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009
---
M scripts/osmo-deps.sh
M scripts/osmo-layer1-headers.sh
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Neels Hofmeyr: Verified
  Harald Welte: Looks good to me, approved



diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh
index 92cf041..74de22b 100755
--- a/scripts/osmo-deps.sh
+++ b/scripts/osmo-deps.sh
@@ -16,5 +16,5 @@
 # the dep subdir separately:
 osmo-clean-workspace.sh
 
-git reset --hard "$branch"
+git checkout -f "$branch"
 git rev-parse HEAD
diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
index 374515e..a975396 100755
--- a/scripts/osmo-layer1-headers.sh
+++ b/scripts/osmo-layer1-headers.sh
@@ -44,4 +44,4 @@
 
 cd layer1-headers
 git fetch origin
-git reset --hard "$version"
+git checkout -f "$version"

-- 
To view, visit https://gerrit.osmocom.org/4469
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list