From 25a88dbf1c557ffd21bb0355c26d5ddabff7c519 Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Tue, 5 Nov 2024 10:33:39 +0100 Subject: [PATCH] style: apply editorconfig to git-forgit --- bin/git-forgit | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/git-forgit b/bin/git-forgit index 7f96f9d..4aebe59 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -169,7 +169,7 @@ _forgit_list_files() { # unquoted. # uniq is necessary because unmerged files are printed once for each # merge conflict. - # With the -z flag, git also uses \0 line termination, so we + # With the -z flag, git also uses \0 line termination, so we # have to replace the terminators. git ls-files -z "$@" "$rootdir" | tr '\0' '\n' | uniq } @@ -556,7 +556,7 @@ _forgit_cherry_pick() { [[ -z $1 ]] && echo "Please specify target branch" && return 1 target="$1" - # in this function, we do something interesting to maintain proper ordering as it's assumed + # in this function, we do something interesting to maintain proper ordering as it's assumed # you generally want to cherry pick oldest->newest when you multiselect # The instances of "cut", "nl" and "sort" all serve this purpose # Please see https://github.com/wfxr/forgit/issues/253 for more details @@ -580,7 +580,7 @@ _forgit_cherry_pick() { commits+=("$commit") done < <(echo "$fzf_selection" | sort -n -k 1 | cut -f2 | cut -d' ' -f1 | _forgit_reverse_lines) [ ${#commits[@]} -eq 0 ] && return 1 - + _forgit_cherry_pick_git_opts=() _forgit_parse_array _forgit_cherry_pick_git_opts "$FORGIT_CHERRY_PICK_GIT_OPTS" git cherry-pick "${_forgit_cherry_pick_git_opts[@]}" "${commits[@]}" @@ -883,7 +883,7 @@ _forgit_revert_commit() { graph=() [[ $_forgit_log_graph_enable == true ]] && graph=(--graph) - # in this function, we do something interesting to maintain proper ordering as it's assumed + # in this function, we do something interesting to maintain proper ordering as it's assumed # you generally want to revert newest->oldest when you multiselect # The instances of "cut", "nl" and "sort" all serve this purpose # Please see https://github.com/wfxr/forgit/issues/253 for more details @@ -896,7 +896,7 @@ _forgit_revert_commit() { _forgit_emojify | nl | FZF_DEFAULT_OPTS="$opts" fzf | - sort -n -k 1 | + sort -n -k 1 | cut -f2- | sed 's/^[^a-f^0-9]*\([a-f0-9]*\).*/\1/')