Skip to content

Remove quotes from TIG_LS_REMOTE to allow inline shell commands#1161

Merged
koutcher merged 1 commit intojonas:masterfrom
krobelus:unquote-TIG_LS_REMOTE
Nov 11, 2021
Merged

Remove quotes from TIG_LS_REMOTE to allow inline shell commands#1161
koutcher merged 1 commit intojonas:masterfrom
krobelus:unquote-TIG_LS_REMOTE

Conversation

@krobelus
Copy link
Copy Markdown
Contributor

The environment variable TIG_LS_REMOTE can be used to select the
references that Tig will display.

When using a command like TIG_LS_REMOTE='sh -c "a | b"' tig, we pass an
argv-array with 3 elements to execvpe. The third argument is passed
with quotes, which means that the shell tries to run a command that
is literally called 'a | b'.

Fix this by removing quotes. We already split arguments with a
shell-like syntax, so this only improves compatibility.

This makes it easier filter away unwanted refs (#1160) without creating
a script TIG_LS_REMOTE.

The environment variable TIG_LS_REMOTE can be used to select the
references that Tig will display.

When using a command like TIG_LS_REMOTE='sh -c "a | b"' tig, we pass an
argv-array with 3 elements to execvpe.  The third argument is passed
with quotes, which means that the shell tries to run a command that
is literally called 'a | b'.

Fix this by removing quotes. We already split arguments with a
shell-like syntax, so this only improves compatibility.

This makes it easier filter away unwanted refs (jonas#1160) without creating
a script TIG_LS_REMOTE.
Copy link
Copy Markdown
Collaborator

@koutcher koutcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@koutcher koutcher merged commit 15aab28 into jonas:master Nov 11, 2021
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
…s#1161)

The environment variable TIG_LS_REMOTE can be used to select the
references that Tig will display.

When using a command like TIG_LS_REMOTE='sh -c "a | b"' tig, we pass an
argv-array with 3 elements to execvpe.  The third argument is passed
with quotes, which means that the shell tries to run a command that
is literally called 'a | b'.

Fix this by removing quotes. We already split arguments with a
shell-like syntax, so this only improves compatibility.

This makes it easier filter away unwanted refs (jonas#1160) without creating
a script TIG_LS_REMOTE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants