Update README some.

This commit is contained in:
William Hilton 2015-11-03 02:03:54 -05:00
parent f9ab6e296c
commit 7298da2cc4
2 changed files with 29 additions and 7 deletions

View file

@ -28,10 +28,11 @@ EDIT: Even better example of inanity of git CLI: To get the SHA reference of HEA
get | git
------------- | -------------
get add <untracked file> | git add <file>
get stage | git add -u :/
get stage %FILES% | git add %FILES%
get stage <tracked file> | git add <file>
get unstage | git reset HEAD
get unstage %FILES% | git reset HEAD %FILES%
get unstage <staged file> | git reset HEAD <file>
get reset | git checkout -f HEAD
get reset %FILES% | git checkout %FILES%
get commit %MESSAGE% | git commit -m %MESSAGE%
@ -53,9 +54,26 @@ get tag %TAG% | git tag %TAG%
get untag %TAG% | Deletes local tag. Y/N prompt to delete remote tag.
get lg | git log --graph --pretty=format:'%h - %d %s (%cr) <%an>' --abbrev-commit -10
Short Aliases | Full
--------------|-----
get ? | get status
get + | get add
get - | get rm
get = | get stage
get ! | get commit
get @ | get branch
get # | get tag
get ^ | get push
### TODO
Now that I've added tab completion, I think "stage" and "status" are too similar.
Also, I have three commands that start with "r" which is a problem.
* ~~Now that I've added tab completion, I think "stage" and "status" are too similar.~~
I've solved that for now by adding short aliases 'get =' and 'get ?'. Not intuitive,
but I didn't want to rename status or stage. (Remember, I'm
trying to keep as much lingo unchanged.) It's the same number of keystrokes as if using
tab completion and one letter. I know, I know, still feels inconvenient somehow.
* Also, I have ~~three~~ four commands that start with "r" which is a problem for tab completion.
Seriously considering renaming 'rmbranch' to 'unbranch' to match 'untag' and 'unstage'.
### Changelog
- I renamed "update" to "fetch" to avoid completion conflicts with "unstage".

View file

@ -39,17 +39,21 @@ case ${COMP_CWORD} in
'=' | stage | reset)
COMPREPLY=( $(compgen -W "$(list_modified)" "$2") )
;;
# <tracked path>
# <staged path>
unstage)
COMPREPLY=( $(compgen -W "$(list_staged)" "$2") )
;;
'-' | rm | diff)
# <tracked path>
'-' | rm)
COMPREPLY=( $(compgen -W "$(list_tracked)" "$2") )
;;
diff)
COMPREPLY=( $(compgen -W "$(list_tracked)" -W "STAGE" -W "HEAD" "$2") )
;;
# <untracked path>
'+' | add)
compopt -o nospace
COMPREPLY=( $(compgen -W "$(list_untracked)" -W "STAGE" -W "HEAD" "$2") )
COMPREPLY=( $(compgen -W "$(list_untracked)" "$2") )
;;
esac
;;