fix formating

pull/3/head
kevin zhuang 4 years ago
parent 2bb0f7fa30
commit 33f381d3d0

@ -16,20 +16,20 @@ function get_commit() {
local files="$2"
if [[ -z "${files}" ]]; then
/usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \
log --oneline --color=always --decorate=short \
log --oneline --color=always --decorate=short \
| fzf --no-multi --header="${header}" \
--preview "echo {} \
--preview "echo {} \
| awk '{print \$1}' \
| xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \
show --color=always __" \
show --color=always __" \
| awk '{print $1}'
else
/usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \
log --oneline --color=always --decorate=short \
log --oneline --color=always --decorate=short \
| fzf --no-multi --header="${header}" --preview "echo {} \
| awk '{print \$1}' \
| xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \
diff --color=always __ $files" \
diff --color=always __ $files" \
| awk '{print $1}'
fi
}
@ -87,9 +87,9 @@ function get_git_file() {
local print_opt="${2:-full}"
set_fzf_multi "$3"
/usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \
ls-files --full-name --directory "${DOTBARE_TREE}" \
ls-files --full-name --directory "${DOTBARE_TREE}" \
| fzf --header="${header}" \
--preview "head -50 ${DOTBARE_TREE}/{}" \
--preview "head -50 ${DOTBARE_TREE}/{}" \
| awk -v home="${DOTBARE_TREE}" -v print_opt="${print_opt}" '{
if (print_opt == "full") {
print home "/" $0
@ -123,7 +123,7 @@ function get_modified_file() {
local output_format="${3:-name}"
set_fzf_multi "$4"
/usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \
status --porcelain \
status --porcelain \
| awk -v display_mode="${display_mode}" '{
if ($0 ~ /^[A-Za-z][A-Za-z].*$/) {
print "\033[32m" substr($0, 1, 1) "\033[31m" substr($0, 2) "\033[0m"
@ -140,7 +140,7 @@ function get_modified_file() {
| fzf --header="${header}" --preview "echo {} \
| awk '{print \$2}' \
| xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \
diff HEAD --color=always ${DOTBARE_TREE}/__" \
diff HEAD --color=always ${DOTBARE_TREE}/__" \
| awk -v home="${DOTBARE_TREE}" -v format="${output_format}" '{
if (format == "name") {
print home "/" $2
@ -163,14 +163,14 @@ function get_stash() {
local header="${1:-select a stash}"
set_fzf_multi "$2"
/usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \
stash list \
stash list \
| fzf --header="${header}" --preview "echo {} \
| awk '{
gsub(/:/, \"\", \$1)
print \$1
}' \
| xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \
show -p __ --color=always" \
show -p __ --color=always" \
| awk '{
gsub(/:/, "", $1)
print $1

@ -26,9 +26,9 @@ function usage() {
echo -e "Stage the selected file to the dotfile gitbare repo"
echo -e "Press escape to stop staging file\n"
echo -e "optional arguments:"
echo -e " -h\t\tshow this help message and exit"
echo -e " -f\t\tselect a file in current directory and stage it"
echo -e " -d\t\tselect a entire folder to stage"
echo -e " -h\tshow this help message and exit"
echo -e " -f\tselect a file in current directory and stage it"
echo -e " -d\tselect a entire folder to stage"
}
#######################################

@ -26,9 +26,9 @@ function usage() {
echo -e "List all tracked dotfiles and edit"
echo -e "also support commit message edit\n"
echo -e "optional arguments:"
echo -e " -h\t\tshow this help message and exit"
echo -e " -m\t\tonly display modified file"
echo -e " -c\t\tedit commit using interactive rebase instead"
echo -e " -h\tshow this help message and exit"
echo -e " -m\tonly display modified file"
echo -e " -c\tedit commit using interactive rebase instead"
}
modified=''

@ -32,11 +32,11 @@ function usage() {
echo -e "Reset/Unstage the selected staged file"
echo -e "Or reset the HEAD to certain commits by using -c flag\n"
echo -e "optional arguments:"
echo -e " -h\t\tshow this help message and exit"
echo -e " -a\t\tselect files and then select a commit to reset the file back to the selected comit"
echo -e " -c\t\treset commit to certain commit, default --mixed flag, reset HEAD to certain commit put all changes into modified states"
echo -e " -S\t\treset commit using --soft flag, reset HEAD to certain commit without modify working tree"
echo -e " -H\t\treset commit using --hard flag, reset HEAD to certain commit dicard all changes from the working tree"
echo -e " -h\tshow this help message and exit"
echo -e " -a\tselect files and then select a commit to reset the file back to the selected comit"
echo -e " -c\treset commit to certain commit, default --mixed flag, reset HEAD to certain commit put all changes into modified states"
echo -e " -S\treset commit using --soft flag, reset HEAD to certain commit without modify working tree"
echo -e " -H\treset commit using --hard flag, reset HEAD to certain commit dicard all changes from the working tree"
}
reset_commit=""

@ -23,7 +23,7 @@ function usage() {
echo -e "Display interactive git status menu"
echo -e "Stage, unstage, interactively\n"
echo -e "optional arguments:"
echo -e " -h\t\tshow this help message and exit"
echo -e " -h\tshow this help message and exit"
}
while getopts ":h" opt; do

Loading…
Cancel
Save