diff --git a/README.md b/README.md index 6e03a21..f8b8d0a 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ takes one of the following arguments or flags | -s,search | search issues in any repository | interactive prompt: follow instructions | -m,myissue | search issues you opened somewhere | interactive prompt: follow instructions | -k,pick | cherrypick files between branches | enter: checkout cherrypicked files from branch +| -e,envs | show git config list | enter: print selected config variable | -h,help | show help page | | -V,version | print the current version | diff --git a/gh-f b/gh-f index ba365dd..3b21be3 100755 --- a/gh-f +++ b/gh-f @@ -25,6 +25,7 @@ COMMANDS -s|search: search issues in any repository -m|myissue: search issues you opened somewhere -k|pick: cherrypick files from one branch to the other + -e|envs: show git config list -h|help: show this help message -V|version: show the current version @@ -86,6 +87,11 @@ USAGE multi-file selection with tab enter: confirm branch and pick files + gh f -e | gh f envs + + show git config --list of environment variables + for the current git project + CUSTOMISATION The prompt colours are defined via their ANSI sequences: if you like different ones you @@ -333,6 +339,11 @@ pick() { [[ -n ${files} ]] && git restore --source "${from_branch}" ${files} } +envs() { + config_var=$(git config --list | cut -d= -f1 | fzf -d' ' --prompt 'config list:' --preview='git config {}') + [[ -n "$config_var" ]] && git config "$config_var" +} + # print help page [[ "$#" -eq 0 ]] && help @@ -384,6 +395,10 @@ while [[ "$#" -gt 0 ]]; do pick shift ;; + -e | envs) + envs + shift + ;; -V | version) echo "$VERSION" shift