Skip to content

Commit 4489478

Browse files
committed
Git Bisect works OK
1 parent 191824a commit 4489478

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"label": "Build",
88
"type": "shell",
99

10-
"command": "set -e ; set -x ; ./run.sh",
10+
"command": "set -e ; set -x ; $PWD/run.sh",
1111

1212
"problemMatcher": "$rustc",
1313
"group": {

my-test-script.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/usr/bin/env bash
2+
## Test a NuttX Commit for Git Bisect
3+
4+
echo ; echo ; echo "--------------------------------------------------------------------------------"
5+
echo "Testing Commit $(git rev-parse HEAD)"
6+
echo "Running https://github.com/lupyuen/nuttx-bisect/blob/main/my-test-script.sh"
7+
echo "Called by https://github.com/lupyuen/nuttx-bisect/blob/main/run.sh"
8+
date -u
29

310
set -e ## Exit when any command fails
411
set -x ## Echo commands
@@ -11,9 +18,14 @@ TZ=UTC0 \
1118
--format="%cd | %H | %s"
1219
nuttx_hash=$(git rev-parse HEAD)
1320

21+
## Visualise the Git Bisect
22+
git bisect log
23+
1424
random_0_or_1=$(( $RANDOM % 2 ))
1525
if (( "$random_0_or_1" == "0" )); then
26+
set +x ; echo "**** Simulate Error" ; set -x
1627
exit 0
1728
else
29+
set +x ; echo "**** Simulate OK" ; set -x
1830
exit 1
1931
fi

run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
## Run Git Bisect on NuttX
23

34
set -e ## Exit when any command fails
45
set -x ## Echo commands
@@ -25,3 +26,6 @@ git bisect good 656883fec5561ca91502a26bf018473ca0229aa4
2526

2627
## Run the Git Bisect automatically
2728
git bisect run $script_dir/my-test-script.sh
29+
30+
## Visualise the Git Bisect
31+
git bisect log

0 commit comments

Comments
 (0)