Skip to content

Commit

Permalink
gi: show files in order given by git
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Mar 1, 2024
1 parent 4523f5a commit f8e95e7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/sh/util/integration/git/gi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fzf() {
printf "%s\n" "$stdin" \
| nl -n rn -w "$width" -s ". " \
| command fzf \
--no-sort \
--layout=reverse \
--height="65%" \
--preview-window="right:65%" \
Expand All @@ -35,14 +36,13 @@ git_show() {
# TODO: most functions have the same template, clean them up.
git_add() {
files="$(
git ls-files --others --exclude-standard
git diff --name-only
git ls-files --others --exclude-standard
)"
[ -z "$files" ] && return

selection="$(
printf "%s\n" "*" "$files" \
| sort -Vu \
| fzf --multi --preview="$PREVIEW"
)"

Expand All @@ -58,7 +58,6 @@ git_partial_add() {

selection="$(
printf "%s\n" "$files" \
| sort -Vu \
| fzf --multi --preview="$PREVIEW"
)"

Expand All @@ -74,7 +73,6 @@ git_unstage() {

selection="$(
printf "%s\n" "$files" \
| sort -Vu \
| fzf --multi --preview="$PREVIEW"
)"

Expand All @@ -90,7 +88,6 @@ git_reset() {

selection="$(
printf "%s\n" "$files" \
| sort -Vu \
| fzf --multi --preview="$PREVIEW"
)"

Expand Down

0 comments on commit f8e95e7

Please sign in to comment.