Add option to ignore untracked files in git pick
This commit is contained in:
parent
4b86dfdfcc
commit
17159d0fa2
2 changed files with 12 additions and 2 deletions
12
bin/git-pick
12
bin/git-pick
|
@ -4,8 +4,18 @@ mkdir -p "$(git rev-parse --git-dir)/fzf"
|
||||||
history="$(git rev-parse --git-dir)/fzf/history"
|
history="$(git rev-parse --git-dir)/fzf/history"
|
||||||
null=$(printf "\0")
|
null=$(printf "\0")
|
||||||
|
|
||||||
|
untracked='/^?? /d'
|
||||||
|
|
||||||
|
while test $# != 0
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
(--untracked | -u) untracked="" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
IFS=''
|
IFS=''
|
||||||
git status --porcelain | while read line
|
git status --porcelain | sed "$untracked" | while read line
|
||||||
do
|
do
|
||||||
path=$(echo $line | cut -b 4-)
|
path=$(echo $line | cut -b 4-)
|
||||||
type=$(echo $line | cut -b -3)
|
type=$(echo $line | cut -b -3)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
dog = log --decorate --oneline --graph --date-order
|
dog = log --decorate --oneline --graph --date-order
|
||||||
fadd = "! git pick | xargs --open-tty git add"
|
fadd = "! git pick | xargs --open-tty git add"
|
||||||
fig = "! git pick | xargs -L1 git ignore"
|
fig = "! git pick | xargs -L1 git ignore"
|
||||||
faddall = "! git status --porcelain | cut -b 4- | fzf --multi --layout=reverse-list | xargs --open-tty git add"
|
faddall = "! git pick --untracked | xargs --open-tty git add"
|
||||||
fixup = "!git commit --patch --no-edit --amend $(git diff --name-only HEAD~1..HEAD)"
|
fixup = "!git commit --patch --no-edit --amend $(git diff --name-only HEAD~1..HEAD)"
|
||||||
h = log -1 --format=%h
|
h = log -1 --format=%h
|
||||||
hash = log -1 --format=%H
|
hash = log -1 --format=%H
|
||||||
|
|
Loading…
Reference in a new issue