diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bfa6d33..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "etc/gitignore"] - path = etc/gitignore - url = git://github.com/github/gitignore.git diff --git a/History.md b/History.md index e63ec8c..e1a03bf 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,14 @@ +0.9.0 / 2012-01-15 +================== + + * Added bash completion support [jweslley] + +0.8.1 / 2011-12-30 +================== + + * Removed `git-promote` + 0.8.0 / 2011-12-08 ================== diff --git a/Makefile b/Makefile index d41fa3d..113482e 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,8 @@ install: cp -f $(BIN) $(PREFIX)/$(BIN); \ ) cp -f man/git-*.1 $(MANPREFIX) + @mkdir -p /etc/bash_completion.d + cp -f etc/bash_completion.sh /etc/bash_completion.d/git-extras docs: $(MAN_HTML) $(MAN_PAGES) @@ -41,6 +43,7 @@ uninstall: echo "... uninstalling $(MANPREFIX)/$(MAN)"; \ rm -f $(MANPREFIX)/$(MAN); \ ) + rm -f /etc/bash_completion.d/git-extras clean: docclean diff --git a/Readme.md b/Readme.md index 43b18c6..47b1510 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ Little git extras. Clone / Tarball: ```bash - $ make install +$ make install ``` One-liner: @@ -32,7 +32,6 @@ $ brew install git-extras - `git pull-request` - `git count` - `git create-branch` - - `git apply-branch` - `git delete-branch` - `git delete-submodule` - `git delete-tag` @@ -299,6 +298,12 @@ $ git ignore build "*.o" "*.log" ... added '*.log' ``` +Add patterns from an existing template: + +```bash +$ git ignore -t rails +``` + Without any patterns, `git-ignore` displays currently ignored patterns: ```bash @@ -316,12 +321,6 @@ Create local and remote branch `name`: $ git create-branch development ``` -Add patterns from an existing template: - -```bash -$ git ignore -t rails -``` - ## git-delete-branch <name> Delete local and remote branch `name`: @@ -426,7 +425,3 @@ Set up a git repository (if one doesn't exist), add all files, and make an initi ## git-touch [filename] Call `touch` on the given file, and add it to the current index. One-step creation of new files. - -## git-promote - -Promotes a local topic branch to a remote tracking branch of the same name, by pushing and then setting up the `git config`. diff --git a/bin/git-extras b/bin/git-extras index 7a98343..8424da6 100755 --- a/bin/git-extras +++ b/bin/git-extras @@ -1,6 +1,6 @@ #!/bin/sh -VERSION="0.8.0" +VERSION="0.9.0" update() { local orig=$PWD diff --git a/bin/git-gh-pages b/bin/git-gh-pages index 40fda3f..0553455 100755 --- a/bin/git-gh-pages +++ b/bin/git-gh-pages @@ -7,6 +7,6 @@ git symbolic-ref HEAD refs/heads/gh-pages \ && echo 'My Page' > index.html \ && git add . \ && git commit -a -m 'Initial commit' \ - && git push origin gh-pages \ + && git push -u origin gh-pages \ && git fetch origin \ - && echo 'complete' \ No newline at end of file + && echo 'complete' diff --git a/bin/git-promote b/bin/git-promote deleted file mode 100755 index 5007f8a..0000000 --- a/bin/git-promote +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||') - -remote_branch=$(git branch -r | grep "origin/${branch}") -test -z "${remote_branch}" && ( git push origin "${branch}" ) - -origin=$(git config --get "branch.${branch}.remote") -test -z "${origin}" && ( git config --add "branch.${branch}.remote" origin ) - -merge=$(git config --get "branch.${branch}.merge") -test -z "${merge}" && ( git config --add "branch.${branch}.merge" "refs/heads/${branch}" ) diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh new file mode 100644 index 0000000..273c680 --- /dev/null +++ b/etc/bash_completion.sh @@ -0,0 +1,49 @@ +# bash completion support for git-extras. + +_git_changelog(){ + __gitcomp "--list" +} + +_git_contrib(){ + __gitcomp "$(git shortlog -s | cut -f2)" # TODO buggy if author's name contains whitespaces :( +} + +_git_count(){ + __gitcomp "--all" +} + +_git_delete_branch(){ + __gitcomp "$(__git_heads)" +} + +_git_delete_submodule(){ + __gitcomp "$(git submodule status | awk '{print $2}')" +} + +_git_delete_tag(){ + __gitcomp "$(__git_tags)" +} + +_git_extras(){ + __gitcomp "--version update" +} + +_git_graft(){ + __gitcomp "$(__git_heads)" +} + +__git_extras_workflow(){ + __gitcomp "$(__git_heads | grep ^$1/ | sed s/^$1\\///g) finish" +} + +_git_feature(){ + __git_extras_workflow "feature" +} + +_git_refactor(){ + __git_extras_workflow "refactor" +} + +_git_bug(){ + __git_extras_workflow "bug" +}