Merge branch 'master' of github.com:visionmedia/git-extras

This commit is contained in:
Tj Holowaychuk 2012-02-01 13:07:27 -08:00
commit 9dca3c36f6
8 changed files with 72 additions and 30 deletions

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "etc/gitignore"]
path = etc/gitignore
url = git://github.com/github/gitignore.git

View file

@ -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
==================

View file

@ -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

View file

@ -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`.

View file

@ -1,6 +1,6 @@
#!/bin/sh
VERSION="0.8.0"
VERSION="0.9.0"
update() {
local orig=$PWD

View file

@ -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'
&& echo 'complete'

View file

@ -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}" )

49
etc/bash_completion.sh Normal file
View file

@ -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"
}