Skip to contentSkip to conversation

diffcol.sh: Use /bin/bash explicitly

PATCH In review Shinya Kuribayashi 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 diffcol.sh: Use /bin/bash explicitly

Recent Ubuntu uses dash (Debian Almquist Shell; a lightweight POSIX- compliant shell derived from ash) as /bin/sh by default. In this case pager=diffcol.sh doesn't work like this:

Quoted 2 lines
skuribay@ubuntu:~/kernel/linux.git$ stg show
/home/skuribay/share/stgit/contrib/diffcol.sh: 22: Bad substitution

this is caused by non-bash-compliant /bin/sh.

diffcol.sh is based on Quilt, and Quilt is dependent on bash; Actually all Quilt scripts use /bin/bash without exceptions. Then it's good for diffcol.sh to use /bin/bash.

---
contrib/diffcol.sh | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
contrib/diffcol.sh +1 -1
index ea9109d..eecc87a 100755
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 

# Code copied from Quilt (http://savannah.nongnu.org/projects/quilt)
#

#1 lore raw
Quoted 3 lines · Shinya Kuribayashi

diffcol.sh is based on Quilt, and Quilt is dependent on bash; Actually all Quilt scripts use /bin/bash without exceptions. Then it's good for diffcol.sh to use /bin/bash.

Thanks for this, and the other patch you sent. I'll be picking them up this weekend, unless Catalin beats me to it.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#2 lore raw

2008/9/3 Karl Hasselström <[email protected]>:

Quoted 8 lines · Shinya Kuribayashi
Quoted 4 lines

diffcol.sh is based on Quilt, and Quilt is dependent on bash; Actually all Quilt scripts use /bin/bash without exceptions. Then it's good for diffcol.sh to use /bin/bash.

Thanks for this, and the other patch you sent. I'll be picking them up this weekend, unless Catalin beats me to it.

BTW, I think at some point we could change to using Git's native colouring. The diffcol.sh script is from the days when Git didn't have this feature. We currently generate a diff string and pass it through the pager but I'm not sure how to do this.

Signature · 1 line
Catalin