Custom git shell to type less and commit more.
Project description
gitbetter
Custom git shell. Type less, commit more.
Installation
Install with:
pip install gitbetter
Usage
Launch from a terminal by entering gitbetter
.
Type help
or ?
for a list of commands.
Type help {command}
for detailed help with a specific command.
By default, If you enter a command that isn't built into gitbetter
, it will be executed directly with os.system()
,
allowing you to perform any command not defined by gitbetter
that your shell supports without having to exit.
To toggle this behavior, run the toggle_unrecognized_command_behavior
(gitbetter
uses tab
for autocomplete, so you can type "tog"
+tab
instead of typing out the whole command name).
When toggled to off, an unrecognized syntax message will be printed if you type in a command gitbetter
doesn't recognize.
The current state of this setting is printed at the bottom when running the help
command.
You can still execute a command in the shell regardless of this setting with the cmd
command.
C:\gitbetter>gitbetter Starting gitbetter... Enter 'help' or '?' for command help. gitbetter::C:\gitbetter>help Documented commands (type help ): ======================================== add delete_branch make_private push add_url delete_gh_repo make_public push_new amend git merge quit cd help new_branch switch cmd ignore new_gh_remote tag commit initcommit new_repo toggle_unrecognized_command_behavior commitall list_branches pull undo commitf loggy pull_branch Unrecognized command behavior: Execute with os.system() ^Essentially makes this shell function as a super-shell of whatever shell you launched gitbetter from.^ gitbetter::C:\gitbetter>help commitf Stage and commit a list of files. Parser help for commitf: usage: gitbetter [-h] -m MESSAGE [-r] [files ...] positional arguments: files List of files to stage and commit. options: -h, --help show this help message and exit -m MESSAGE, --message MESSAGE The commit message to use. -r, --recursive If a file name is not found in the current working directory, search for it in subfolders. This avoids having to type paths to files in subfolders, but if you have multiple files in different subfolders with the same name that have changes they will all be staged and committed. gitbetter::C:\gitbetter>help loggy Execute `git --oneline --name-only --abbrev-commit --graph`. gitbetter::C:\gitbetter>loggy * 3e780ec (HEAD -> main, tag: v1.0.0) Merge branch 'my-feature' |\ | * b4478a3 feat: new print statement | | test.py * | eb89c2e docs: update readme |/ | README.md * fc6b7ac (origin/main) docs: update readme | README.md * 2a75c0c docs: added a comment | test.py * d22129a feat: new print statement | gitbetter_test.py * 1a002d7 chore: add items to ignore | .gitignore * 92cb7e7 Initial commit .gitignore LICENSE.txt README.md gitbetter_test.py test.py test.txt
Bindings can be accessed programmatically:
>>> from gitbetter import git >>> git.loggy() * 3e780ec (HEAD -> main, tag: v1.0.0) Merge branch 'my-feature' |\ | * b4478a3 feat: new print statement | | test.py * | eb89c2e docs: update readme |/ | README.md * fc6b7ac (origin/main) docs: update readme | README.md * 2a75c0c docs: added a comment | test.py * d22129a feat: new print statement | gitbetter_test.py * 1a002d7 chore: add items to ignore | .gitignore * 92cb7e7 Initial commit .gitignore LICENSE.txt README.md gitbetter_test.py test.py test.txt >>> git.list_branches() * main 3e780ec [origin/main: ahead 3] Merge branch 'my-feature' remotes/origin/main fc6b7ac docs: update readme
Future Features
- Redirect the output of git commands so the bindings return the output instead of only being able to print.
- Make pushing to remote after creating it smoother (make it so you don't manually have to add the url).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gitbetter-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff1fc9d0fc3d613a2930c753a5eb982c2338a6b83f92c48f9213ec69a65ba2cc |
|
MD5 | 71a90b2aad3a870d945b696b3d7f4f34 |
|
BLAKE2b-256 | 7390cf5c314e8b639af2fe21acce86931649ab6ac8b5d6e2af2945b3bcbeb68b |