jonas / tig

Text-mode interface for git
https://jonas.github.io/tig/
GNU General Public License v2.0
12.41k stars 606 forks source link

[question] How to launch a command and substitute an environment variable? #1321

Closed MartyLake closed 6 months ago

MartyLake commented 6 months ago

Hello, Actually, this mapping

bind status f !git absorb -v --base $GIT_ABSORB_BASE
bind diff f !git absorb -v --base $GIT_ABSORB_BASE

calls git absorb -v --base "$GIT_ABSORB_BASE" with no substitution..

I would expect it to call git absorb -v --base $GIT_ABSORB_BASE instead, allowing the environment variable to be inserted in-place of $GIT_ABSORB_BASE.

Do you know how to do it ?

Best,

koutcher commented 6 months ago

Try with bind diff f !sh -c "git absorb -v --base $GIT_ABSORB_BASE".

MartyLake commented 6 months ago

It works, thanks!