Skip to content

Commit

Permalink
Merge pull request #33 from gennaro-tedesco/view_tag_commit
Browse files Browse the repository at this point in the history
added fzf expect key to show commit for tag
  • Loading branch information
gennaro-tedesco authored Mar 26, 2024
2 parents 3275760 + 0f35bce commit 29fc570
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gh-f
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ USAGE
enter: checkout the tag in detached HEAD state
ctrl-d: diff the tag against current branch
ctrl-v: show commit the tag points to
gh f -s | gh f search
Expand Down Expand Up @@ -349,8 +350,8 @@ tags() {
--ansi --delimiter=: \
--prompt="tags:" \
--preview="GH_FORCE_TTY=$FZF_PREVIEW_COLUMNS git diff --stat --color=always {1} 2>/dev/null" \
--expect="enter,ctrl-d" \
--header=$'Enter: checkout tag, Ctrl-d: diff tag\n\n' \
--expect="enter,ctrl-d,ctrl-v" \
--header=$'Enter: checkout tag, Ctrl-d: diff tag, Ctrl-v: view tag commit\n\n' \
--no-info
)"

Expand All @@ -360,6 +361,7 @@ tags() {
case "$key" in
enter) git checkout tags/"$tag" ;;
ctrl-d) git diff "$tag" ;;
ctrl-v) git log -1 tags/"$tag" ;;
esac
}

Expand Down

0 comments on commit 29fc570

Please sign in to comment.