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

Ability to use forgit commands as sub-commands of git (e.g. git forgit log) #164

Merged
merged 10 commits into from
Oct 22, 2021

Conversation

wren
Copy link
Contributor

@wren wren commented Oct 18, 2021

Check list

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation

Description

Fixes #147

This works by adding a file (bin/git-forgit) that acts as a bridge between forgit and git. The file takes any command, changes underscores to double colons (_::), and forwards all arguments to the associated function in forgit.plugin.zsh. For example, git forgit log becomes forgit::log, and git forgit checkout_file README.md becomes forgit::checkout::file README.md.

This file should be future-proof as long as the current naming scheme continues, so it won't need to be updated every time a new command is added.

Also, this relies on the user setting an environment variable named FORGIT_STANDALONE. All new code in forgit is hidden behind this new flag, so no current users will see any change in behavior or performance when updating forgit.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation change

Test environment

  • Shell
    • bash
    • zsh
    • fish
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Others:

wren and others added 8 commits October 17, 2021 22:56
Using an underscore instead of a dash simplifies the workflow and
documentation by making the commands and environment variables that
forgit uses the same (i.e. `git forgit checkout_file` is the same
command referred to by `forgit_checkout_file`)
@wfxr wfxr merged commit eb6db72 into wfxr:master Oct 22, 2021
@wfxr
Copy link
Owner

wfxr commented Oct 22, 2021

@wren Merged. Thanks again for your contirbution !

wfxr added a commit that referenced this pull request Oct 25, 2021
@wren wren deleted the git-forgit-147 branch October 29, 2021 14:25
ethan605 pushed a commit to ethan605/forgit that referenced this pull request Jan 29, 2022
ethan605 pushed a commit to ethan605/forgit that referenced this pull request Jan 29, 2022
@wfxr
Copy link
Owner

wfxr commented May 31, 2022

@wren Can you help take a look at #210 ?

@wren
Copy link
Contributor Author

wren commented May 31, 2022

@wren Can you help take a look at #210 ?

Yeah, I think I have some time at the end of this week to take a look.

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.

Ability to use the commands as sub-commands of git
3 participants