Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Dec 16, 2021
Merged

Conversation

mroth
Copy link
Owner

@mroth mroth commented Dec 12, 2021

[reserved for full PR description]

  • remove hub force aliasing
  • respect existing SCMPUFF_GIT_CMD if preset (either before or after scruff is inited)
  • add integration tests
  • update documentation

@mroth
Copy link
Owner Author

mroth commented Dec 12, 2021

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.

@mroth mroth merged commit ffe12a6 into master Dec 16, 2021
@mroth mroth deleted the no-force-hub branch December 16, 2021 23:34
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.

1 participant