Checklist
Output of fzf --version
0.73.1 (refs/tags/v0.73.1)
OS
Shell
Problem / Steps to reproduce
I'm using fzf as a git log --graph viewer with preview (similar to gitk)
Am making a bind to jump to selected commit's first parent, using transform-search()+best
Expected alt-j (binding below) to be atomic and sequential execution of:
transform-search() /w command to return selected commit's first parent's SHA (alt-k)
best to jump both search and selection to that parent (alt-l)
Observing alt-j:
Hard to describe, it seems as ifbest partially executes first, then transform-search(), then remainder of best.
- (optional) enter a query to apply a search filter and/or
ctrl-j to change selection
- records curr selection, let's call it "commit A"
- jumps selection to first match of the current search/query, "commit B"
- search is updated to highlight commit A's parent
The strange order of operations is very evident by applying 1. so selection differs from search filter, then repeating alt-j, causing search & selection to keep swapping places. The section will "chase" the previous search result, and the search result will "chase" the previous selection's parent. This is distinctly different from alt-k alt-l or alt-k ctrl-n, which behaves as expected.
Minimal repro:
git log --graph --all --oneline --decorate --color | \
fzf --ansi --no-sort --reverse --raw \
--bind alt-j:"transform-search(git lg-sha {} | xargs git parents-short | cut -f 1 -d ' ')+best" \
--bind alt-k:"transform-search(git lg-sha {} | xargs git parents-short | cut -f 1 -d ' ')" \
--bind alt-l:best
The git aliases being used:
# takes a line from git log --graph output, only returns the SHA
lg-sha = "!f() { \
echo \"$1\" | grep -Eo '^\\W+ [0-9a-f]+' | grep -o '\\S*$'; \
}; f"
# parents of given ref, trimming to same length as input
parents-short = "!f() { git log --pretty=%P -n 1 $1 | tr ' ' '\\n' | cut -c1-$(echo -n $1 | wc -c) | xargs; }; f"
Have also tried many variations, e.g. best+transform-search(), best+transform-search()+best(), transform-query(), first, down-match, etc
Checklist
man fzf)Output of
fzf --version0.73.1 (refs/tags/v0.73.1)
OS
Shell
Problem / Steps to reproduce
I'm using fzf as a git log --graph viewer with preview (similar to
gitk)Am making a bind to jump to selected commit's first parent, using
transform-search()+bestExpected
alt-j(binding below) to be atomic and sequential execution of:transform-search()/w command to return selected commit's first parent's SHA (alt-k)bestto jump both search and selection to that parent (alt-l)Observing
alt-j:Hard to describe, it seems as if
bestpartially executes first, thentransform-search(), then remainder ofbest.ctrl-jto change selectionThe strange order of operations is very evident by applying
1.so selection differs from search filter, then repeatingalt-j, causing search & selection to keep swapping places. The section will "chase" the previous search result, and the search result will "chase" the previous selection's parent. This is distinctly different fromalt-kalt-loralt-kctrl-n, which behaves as expected.Minimal repro:
The git aliases being used:
Have also tried many variations, e.g.
best+transform-search(),best+transform-search()+best(),transform-query(),first,down-match, etc