fix(git-bulk): fix workspace selection when cd fails by pierreay · Pull Request #1197 · tj/git-extras
`cd` may fails for multiple reasons: - mistake when editing `.gitconfig` manually - previously existing workspace that have been removed - ... Currently, if `cd` fails, the `BulkOp` continue its execution ... in the workspace defined in a higher directory that where the user, despite the user specified a specific workspace (`-w`). The user should be noticed of a failed `cd` (this is really not expected for a valid configuration) and the operations should stop to not execute something unexpected.
marked this pull request as ready for review
Get rid of poor `eval` syntax because they are vulnerable to command
injection, which may have unexpected side effects.
However, they enabled a useful feature: using environment variable
(*e.g.*, defined in a `.bashrc`) inside the `.gitconfig` to use dynamic
paths as `bulk` workspaces.
As such, I keep this feature possible by using the Bash's ${!VAR}
syntax, which allows to get the value of one variable using the name of
a another variable. However, arbitrary command injection is not possible
anymore.
Pierre Ayoub added 6 commits
February 24, 2025 17:02This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters