mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
feat: support commit ref parameters for glo. #85
Former-commit-id: bd67dcbddd
This commit is contained in:
parent
2288ecb46d
commit
9f0c261680
|
|
@ -169,7 +169,7 @@ FORGIT_STASH_FZF_OPTS='
|
|||
## Tips
|
||||
|
||||
- Hit `q` to quit from full screen preview any time.
|
||||
- Commands like `glo`, `gd`, `gcf` and `gclean` accept path arguments to restrain the items listed in fzf(eg, `glo main.go test.go`, `gclean output/`).
|
||||
- Commands like `glo`, `gd`, `gcf` and `gclean` accept arguments to restrain the items listed in fzf(eg, `glo develop`, `glo f738479..188a849b -- main.go`, `gclean output/` etc.).
|
||||
- `gd` supports specifying revision(eg, `gd HEAD~`, `gd v1.0 README.md`).
|
||||
- Call `gi` with arguments to get the wanted `.gitignore` contents directly(eg, `gi cmake c++`).
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@ forgit_pager=$(git config core.pager || echo 'cat')
|
|||
# git commit viewer
|
||||
forgit::log() {
|
||||
forgit::inside_work_tree || return 1
|
||||
local cmd opts graph
|
||||
cmd="echo {} |grep -Eo '[a-f0-9]+' |head -1 |xargs -I% git show --color=always % $* | $forgit_pager"
|
||||
local cmd opts graph files
|
||||
files=$(sed -nE 's/.* -- (.*)/\1/p' <<< "$*")
|
||||
cmd="echo {} |grep -Eo '[a-f0-9]+' |head -1 |xargs -I% git show --color=always % -- $files | $forgit_pager"
|
||||
opts="
|
||||
$FORGIT_FZF_DEFAULT_OPTS
|
||||
+s +m --tiebreak=index
|
||||
|
|
|
|||
Loading…
Reference in a new issue