From b2e26067ac107d64f5d83beae44dded425b2ce6d Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Fri, 23 Dec 2022 12:04:41 +0800 Subject: [PATCH] gdebug supports empty; --dry-run wip --- .zshrc2 | 4 ++-- tools/common.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.zshrc2 b/.zshrc2 index 92a06eb..014b5a7 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -100,7 +100,7 @@ alias "se"='sudo -sE' alias "pbd"='ping baidu.com' alias "p114"='ping 114.114.114.114' alias "p666"='ping6 2001:da8::666' -alias "gdebug"='git add -A; git commit -m "bug fix ($(date))"' +alias "gdebug"='git add -A; git commit --allow-empty -m "bug fix ($(date))"' case $(bash "$DOTFILES/tools/common.sh" get_os_type) in macos ) alias l='ls -lAGh -D "%y-%m-%d %H:%M"' ;; * ) alias l='ls -lAGh --time-style="+%y-%m-%d %H:%M"' ;; @@ -165,7 +165,7 @@ dfs() $EDITOR ~/.config/dotfiles/env ;; force-update ) ( - cd "$DOTFILES" + cd "$DOTFILES" git fetch --all ref=$(git symbolic-ref --short HEAD 2> /dev/null) || ref=$(git rev-parse --short HEAD 2> /dev/null) || return 0 for i in $(git for-each-ref refs/heads --format='%(refname)') ; do git checkout ${i#refs/heads/} ; git pull --ff-only ; done diff --git a/tools/common.sh b/tools/common.sh index 4e9163e..b9b3662 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -15,6 +15,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then -q*|--quite ) export DFS_QUIET=1 ;; -l*|--lite ) export DFS_LITE=1 ;; --color ) export DFS_COLOR=1 ;; + --dry-run ) export DFS_DRY_RUN=1 ;; --*=* ) GOT_OPTS+=("${ARG%%=*}" "${ARG#*=}") ;; --* ) GOT_OPTS+=("$ARG") ;; -* ) GOT_OPTS+=("${ARG:0:2}") ;;