Add option to ignore untracked files in git pick

This commit is contained in:
Talia 2024-08-14 11:43:02 +02:00
parent 4b86dfdfcc
commit 17159d0fa2
2 changed files with 12 additions and 2 deletions

View File

@ -4,8 +4,18 @@ mkdir -p "$(git rev-parse --git-dir)/fzf"
history="$(git rev-parse --git-dir)/fzf/history"
null=$(printf "\0")
untracked='/^?? /d'
while test $# != 0
do
case "$1" in
(--untracked | -u) untracked="" ;;
esac
shift
done
IFS=''
git status --porcelain | while read line
git status --porcelain | sed "$untracked" | while read line
do
path=$(echo $line | cut -b 4-)
type=$(echo $line | cut -b -3)

View File

@ -22,7 +22,7 @@
dog = log --decorate --oneline --graph --date-order
fadd = "! git pick | xargs --open-tty git add"
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)"
h = log -1 --format=%h
hash = log -1 --format=%H