[PATCH 2/2] bash-completion: fix shellcheck SC2268

2021-11-16 Thread Daniel Vetter
if [[ "x$1" = "xcd" ]]; then
  ^---^ SC2268: Avoid x-prefix in comparisons as it no longer 
serves a purpose.

Signed-off-by: Daniel Vetter 
---
 bash_completion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bash_completion b/bash_completion
index 8dcf61ae42d1..e88aa4f98f2d 100644
--- a/bash_completion
+++ b/bash_completion
@@ -2,7 +2,7 @@
 
 dim ()
 {
-   if [[ "x$1" = "xcd" ]]; then
+   if [[ "$1" = "cd" ]]; then
cd $(cat ~/.dim-last-path) || exit
else
command dim "$@"
-- 
2.33.0



[PATCH 1/2] dim: Error checking for git commit in rebuild-tip

2021-11-16 Thread Daniel Vetter
There's nothing we can do, but also I was baffled about what's going on.
The reason was that a topic branch was deleted on the server, but not
removed from nightly.conf. Which means git merge fails, but not in a way
we expect, so we keep falling over until this git commit (which should
always succeed) also falls over and the scrip just stops.

Make the failure a notch more verbose for next time around.

Signed-off-by: Daniel Vetter 
---
 dim | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 9da768fe5f5b..d382d41bbb5c 100755
--- a/dim
+++ b/dim
@@ -798,7 +798,10 @@ function dim_rebuild_tip
 
# because we filter out fast-forward merges there will
# always be something to commit
-   git commit --no-edit --quiet --no-verify
+   if ! git commit --no-edit --quiet --no-verify ; then
+   echoerr "Commit failed, missing topic branch?"
+   return 1
+   fi
echo "Done."
fi
 
-- 
2.33.0