mroth / scmpuff

:1234: Numeric file shortcuts for common git commands
https://mroth.github.io/scmpuff/
MIT License
384 stars 22 forks source link

don't force hub usage in git-wrapper if installed #62

Closed mroth closed 2 years ago

mroth commented 2 years ago

[reserved for full PR description]

mroth commented 2 years ago

WIP explanation: the default git wrapper currently contains the following with regards to setting the default git command:

# Remove any existing git alias or function
unalias git > /dev/null 2>&1
unset -f git > /dev/null 2>&1

# Use the full path to git to avoid infinite loop with git function
export SCMPUFF_GIT_CMD="$(\which git)"

# Wrap git with the 'hub' github wrapper, if installed
if type hub > /dev/null 2>&1; then export SCMPUFF_GIT_CMD="hub"; fi

At the time I first wrote this program, hub was very popular, and I wanted to ensure scmpuff didn't clash with it, so we check if it's installed anywhere on the path and if so, manually make it the default git command. Since hub is less popular now (largely supplanted by the official gh CLI tool which does not rely on wrapping git), let's make that a manual choice.

I propose to remove this behavior in the next major release of scmpuff. In order to do so, the, those who wish to wrap with both hub and scmpuff would simply need to set SCMPUFF_GIT_CMD=/path/to/hub in their environment variables. We would need to update the documentation to reflect this at the time.