William Durand: 3 Some more zsh fixes Update pure git: reformat gitconfig 7 files changed, 443 insertions(+), 205 deletions(-)
Thanks!
Thanks!
Thanks!
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.sr.ht/~willdurand/public-inbox/patches/20250/mbox | git am -3Learn more about email & git
Signed-off-by: William Durand <will+git@drnd.me> --- zsh/zshrc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/zsh/zshrc b/zsh/zshrc index 6fdc6a3..50cf88f 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -18,6 +18,8 @@ fi export EDITOR='vim' export GIT_EDITOR='vim' export SHELL='/bin/zsh' +# Disable husky +export HUSKY_SKIP_HOOKS=1 # Fix Locale export LC_ALL=en_US.UTF-8 @@ -28,9 +30,6 @@ export HISTSIZE=100000 export HISTFILE="$HOME/.history" export SAVEHIST="$HISTSIZE" -# Disable husky -export HUSKY_SKIP_HOOKS=1 - # Remove superfluous blanks from each command line being added to the history # list setopt histreduceblanks @@ -88,8 +87,9 @@ zstyle ':completion:*' ignored-patterns 'package-lock.json' zstyle ':completion:*:descriptions' format '%U%F{yellow}%d%f%u' zstyle ':completion:*:*:git:*' script ~/.git-completion.bash -# Reverse search -bindkey -e +bindkey '^A' beginning-of-line +bindkey '^E' end-of-line +bindkey '^R' history-incremental-search-backward # Pager, thanks François <3 if [[ -x $(which less) ]] ; then @@ -111,13 +111,12 @@ fi alias ls='ls -hFG' alias ll='ls -lAhFG' alias dstat='dstat -dcgilmsy' -alias projects="cd ~/projects/" # convenient aliases alias diff=icdiff alias fixprompt=prompt_pure_async_init=0; async_stop_worker prompt_pure -# git + hub +# git/hub HUB=$(which hub) if [[ -x "$HUB" ]]; then eval "$($HUB alias -s)" @@ -137,7 +136,7 @@ if [[ -x $(which bat) ]]; then fi # hit C-X C-E to open your $EDITOR with the command typed in the buffer -# and quickly edit your error +# and quickly edit your error. autoload edit-command-line zle -N edit-command-line bindkey '^X^E' edit-command-line @@ -148,10 +147,10 @@ export FZF_DEFAULT_COMMAND='rg --files --hidden' # Common PATH export PATH="/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/X11/bin:/Developer/usr/bin" export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" +export PATH="/usr/local/sbin:$PATH" # Homebrew export HOMEBREW_NO_ANALYTICS=1 -export PATH="/usr/local/sbin:$PATH" # Node if [[ -x $(which yarn) ]] ; then @@ -160,6 +159,7 @@ fi # Ruby, lazy load rbenv because I do not use it too often rbenv() { + unset -f rbenv eval "$(command rbenv init -)" rbenv "$@" } @@ -170,6 +170,7 @@ if [[ -d "$HOME/.phpenv" ]]; then # lazy load phpenv because I do not use it too often phpenv() { + unset -f -f phpenv eval "$(command phpenv init -)" phpenv "$@" } -- 2.30.0
Thanks!
Signed-off-by: William Durand <will+git@drnd.me> --- zsh/pure/async.zsh | 199 ++++++++++++++++++++++++++++++------------ zsh/pure/package.json | 5 +- zsh/pure/pure.zsh | 187 +++++++++++++++++++++++++++++++-------- zsh/pure/readme.md | 102 ++++++++++++++-------- zsh/zshrc | 4 +- 5 files changed, 367 insertions(+), 130 deletions(-) diff --git a/zsh/pure/async.zsh b/zsh/pure/async.zsh index d0f3f00..08ed3a6 100644 --- a/zsh/pure/async.zsh +++ b/zsh/pure/async.zsh @@ -3,12 +3,12 @@ # # zsh-async # -# version: 1.7.2 +# version: v1.8.4 # author: Mathias Fredriksson # url: https://github.com/mafredri/zsh-async # -typeset -g ASYNC_VERSION=1.7.2 +typeset -g ASYNC_VERSION=1.8.4 # Produce debug output from zsh-async when set to 1. typeset -g ASYNC_DEBUG=${ASYNC_DEBUG:-0} @@ -37,19 +37,27 @@ _async_job() { # block, after the command block has completed, the stdin for `cat` is # closed, causing stderr to be appended with a $'\0' at the end to mark the # end of output from this job. - local jobname=${ASYNC_JOB_NAME:-$1} - local stdout stderr ret tok - { - stdout=$(eval "$@") - ret=$? - duration=$(( EPOCHREALTIME - duration )) # Calculate duration. + local jobname=${ASYNC_JOB_NAME:-$1} out + out="$( + local stdout stderr ret tok + { + stdout=$(eval "$@") + ret=$? + duration=$(( EPOCHREALTIME - duration )) # Calculate duration. + + print -r -n - $'\0'${(q)jobname} $ret ${(q)stdout} $duration + } 2> >(stderr=$(cat) && print -r -n - " "${(q)stderr}$'\0') + )" + if [[ $out != $'\0'*$'\0' ]]; then + # Corrupted output (aborted job?), skipping. + return + fi - # Grab mutex lock, stalls until token is available. - read -r -k 1 -p tok || exit 1 + # Grab mutex lock, stalls until token is available. + read -r -k 1 -p tok || return 1 - # Return output (<job_name> <return_code> <stdout> <duration> <stderr>). - print -r -n - $'\0'${(q)jobname} $ret ${(q)stdout} $duration - } 2> >(stderr=$(cat) && print -r -n - " "${(q)stderr}$'\0') + # Return output (<job_name> <return_code> <stdout> <duration> <stderr>). + print -r -n - "$out" # Unlock mutex by inserting a token. print -n -p $tok @@ -73,10 +81,13 @@ _async_worker() { # When a zpty is deleted (using -d) all the zpty instances created before # the one being deleted receive a SIGHUP, unless we catch it, the async # worker would simply exit (stop working) even though visible in the list - # of zpty's (zpty -L). - TRAPHUP() { - return 0 # Return 0, indicating signal was handled. - } + # of zpty's (zpty -L). This has been fixed around the time of Zsh 5.4 + # (not released). + if ! is-at-least 5.4.1; then + TRAPHUP() { + return 0 # Return 0, indicating signal was handled. + } + fi local -A storage local unique=0 @@ -121,15 +132,33 @@ _async_worker() { # Register a SIGCHLD trap to handle the completion of child processes. trap child_exit CHLD - # Process option parameters passed to worker - while getopts "np:u" opt; do + # Process option parameters passed to worker. + while getopts "np:uz" opt; do case $opt in n) notify_parent=1;; p) parent_pid=$OPTARG;; u) unique=1;; + z) notify_parent=0;; # Uses ZLE watcher instead. esac done + # Terminate all running jobs, note that this function does not + # reinstall the child trap. + terminate_jobs() { + trap - CHLD # Ignore child exits during kill. + coproc : # Quit coproc. + coproc_pid=0 # Reset pid. + + if is-at-least 5.4.1; then + trap '' HUP # Catch the HUP sent to this process. + kill -HUP -$$ # Send to entire process group. + trap - HUP # Disable HUP trap. + else + # We already handle HUP for Zsh < 5.4.1. + kill -HUP -$$ # Send to entire process group. + fi + } + killjobs() { local tok local -a pids @@ -143,9 +172,8 @@ _async_worker() { # process is in the middle of writing to stdin during kill. (( coproc_pid )) && read -r -k 1 -p tok - kill -HUP -$$ # Send to entire process group. - coproc : # Quit coproc. - coproc_pid=0 # Reset pid. + terminate_jobs + trap child_exit CHLD # Reinstall child trap. } local request do_eval=0 @@ -153,17 +181,27 @@ _async_worker() { while :; do # Wait for jobs sent by async_job. read -r -d $'\0' request || { - # Since we handle SIGHUP above (and thus do not know when `zpty -d`) - # occurs, a failure to read probably indicates that stdin has - # closed. This is why we propagate the signal to all children and - # exit manually. - kill -HUP -$$ # Send SIGHUP to all jobs. - exit 0 + # Unknown error occurred while reading from stdin, the zpty + # worker is likely in a broken state, so we shut down. + terminate_jobs + + # Stdin is broken and in case this was an unintended + # crash, we try to report it as a last hurrah. + print -r -n $'\0'"'[async]'" $(( 127 + 3 )) "''" 0 "'$0:$LINENO: zpty fd died, exiting'"$'\0' + + # We use `return` to abort here because using `exit` may + # result in an infinite loop that never exits and, as a + # result, high CPU utilization. + return $(( 127 + 1 )) } + # We need to clean the input here because sometimes when a zpty + # has died and been respawned, messages will be prefixed with a + # carraige return (\r, or \C-M). + request=${request#$'\C-M'} + # Check for non-job commands sent to worker case $request in - _unset_trap) notify_parent=0; continue;; _killjobs) killjobs; continue;; _async_eval*) do_eval=1;; esac @@ -175,9 +213,11 @@ _async_worker() { # Name of the job (first argument). local job=$cmd[1] - # If worker should perform unique jobs - if (( unique )); then - # Check if a previous job is still running, if yes, let it finnish + # Check if a worker should perform unique jobs, unless + # this is an eval since they run synchronously. + if (( !do_eval )) && (( unique )); then + # Check if a previous job is still running, if yes, + # skip this job and let the previous one finish. for pid in ${${(v)jobstates##*:*:}%\=*}; do if [[ ${storage[$job]} == $pid ]]; then continue 2 @@ -317,7 +357,7 @@ _async_zle_watcher() { async_stop_worker $worker if [[ -n $callback ]]; then - $callback '[async]' 2 "" 0 "$worker:zle -F $1 returned error $2" 0 + $callback '[async]' 2 "" 0 "$0:$LINENO: error: fd for $worker failed: zle -F $1 returned error $2" 0 fi return fi; @@ -327,6 +367,28 @@ _async_zle_watcher() { fi } +_async_send_job() { + setopt localoptions noshwordsplit noksharrays noposixidentifiers noposixstrings + + local caller=$1 + local worker=$2 + shift 2 + + zpty -t $worker &>/dev/null || { + typeset -gA ASYNC_CALLBACKS + local callback=$ASYNC_CALLBACKS[$worker] + + if [[ -n $callback ]]; then + $callback '[async]' 3 "" 0 "$0:$LINENO: error: no such worker: $worker" 0 + else + print -u2 "$caller: no such async worker: $worker" + fi + return 1 + } + + zpty -w $worker "$@"$'\0' +} + # # Start a new asynchronous job on specified worker, assumes the worker is running. # @@ -344,8 +406,7 @@ async_job() { cmd=(${(q)cmd}) # Quote special characters in multi argument commands. fi - # Quote the cmd in case RC_EXPAND_PARAM is set. - zpty -w $worker "$cmd"$'\0' + _async_send_job $0 $worker "$cmd" } # @@ -369,7 +430,7 @@ async_worker_eval() { fi # Quote the cmd in case RC_EXPAND_PARAM is set. - zpty -w $worker "_async_eval $cmd"$'\0' + _async_send_job $0 $worker "_async_eval $cmd" } # This function traps notification signals and calls all registered callbacks @@ -392,7 +453,7 @@ _async_notify_trap() { async_register_callback() { setopt localoptions noshwordsplit nolocaltraps - typeset -gA ASYNC_CALLBACKS + typeset -gA ASYNC_PTYS ASYNC_CALLBACKS local worker=$1; shift ASYNC_CALLBACKS[$worker]="$*" @@ -401,6 +462,14 @@ async_register_callback() { # workers to notify (via -n) when a job is done. if [[ ! -o interactive ]] || [[ ! -o zle ]]; then trap '_async_notify_trap' WINCH + elif [[ -o interactive ]] && [[ -o zle ]]; then + local fd w + for fd w in ${(@kv)ASYNC_PTYS}; do + if [[ $w == $worker ]]; then + zle -F $fd _async_zle_watcher # Register the ZLE handler. + break + fi + done fi } @@ -462,15 +531,38 @@ async_flush_jobs() { # -p pid to notify (defaults to current pid) # async_start_worker() { - setopt localoptions noshwordsplit + setopt localoptions noshwordsplit noclobber local worker=$1; shift + local -a args + args=("$@") zpty -t $worker &>/dev/null && return typeset -gA ASYNC_PTYS typeset -h REPLY typeset has_xtrace=0 + if [[ -o interactive ]] && [[ -o zle ]]; then + # Inform the worker to ignore the notify flag and that we're + # using a ZLE watcher instead. + args+=(-z) + + if (( ! ASYNC_ZPTY_RETURNS_FD )); then + # When zpty doesn't return a file descriptor (on older versions of zsh) + # we try to guess it anyway. + integer -l zptyfd + exec {zptyfd}>&1 # Open a new file descriptor (above 10). + exec {zptyfd}>&- # Close it so it's free to be used by zpty. + fi + fi + + # Workaround for stderr in the main shell sometimes (incorrectly) being + # reassigned to /dev/null by the reassignment done inside the async + # worker. + # See https://github.com/mafredri/zsh-async/issues/35. + integer errfd=-1 + exec {errfd}>&2 + # Make sure async worker is started without xtrace # (the trace output interferes with the worker). [[ -o xtrace ]] && { @@ -478,23 +570,19 @@ async_start_worker() { unsetopt xtrace } - if (( ! ASYNC_ZPTY_RETURNS_FD )) && [[ -o interactive ]] && [[ -o zle ]]; then - # When zpty doesn't return a file descriptor (on older versions of zsh) - # we try to guess it anyway. - integer -l zptyfd - exec {zptyfd}>&1 # Open a new file descriptor (above 10). - exec {zptyfd}>&- # Close it so it's free to be used by zpty. - fi - - zpty -b $worker _async_worker -p $$ $@ || { - async_stop_worker $worker - return 1 - } + zpty -b $worker _async_worker -p $$ $args 2>&$errfd + local ret=$? # Re-enable it if it was enabled, for debugging. (( has_xtrace )) && setopt xtrace + exec {errfd}>& - - if [[ $ZSH_VERSION < 5.0.8 ]]; then + if (( ret )); then + async_stop_worker $worker + return 1 + fi + + if ! is-at-least 5.0.8; then # For ZSH versions older than 5.0.8 we delay a bit to give # time for the worker to start before issuing commands, # otherwise it will not be ready to receive them. @@ -506,11 +594,7 @@ async_start_worker() { REPLY=$zptyfd # Use the guessed value for the file desciptor. fi - ASYNC_PTYS[$REPLY]=$worker # Map the file desciptor to the worker. - zle -F $REPLY _async_zle_watcher # Register the ZLE handler. - - # Disable trap in favor of ZLE handler when notify is enabled (-n). - async_job $worker _unset_trap + ASYNC_PTYS[$REPLY]=$worker # Map the file desciptor to the worker. fi } @@ -556,6 +640,9 @@ async_init() { zmodload zsh/zpty zmodload zsh/datetime + # Load is-at-least for reliable version check. + autoload -Uz is-at-least + # Check if zsh/zpty returns a file descriptor or not, # shell must also be interactive with zle enabled. typeset -g ASYNC_ZPTY_RETURNS_FD=0 diff --git a/zsh/pure/package.json b/zsh/pure/package.json index 61b5cdf..6ba0fee 100644 --- a/zsh/pure/package.json +++ b/zsh/pure/package.json @@ -1,6 +1,6 @@ { "name": "pure-prompt", - "version": "1.11.0", + "version": "1.16.0", "description": "Pretty, minimal and fast ZSH prompt", "license": "MIT", "repository": "sindresorhus/pure", @@ -18,7 +18,8 @@ "scripts": { "postinstall": "PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; PURE_DEST=\"$PWD/functions\" npm run postinstall-link && npm run postinstall-fail-instructions", "postinstall-link": "mkdir -p \"$PURE_DEST\" && ln -sf \"$PWD/pure.zsh\" \"$PURE_DEST/prompt_pure_setup\" && ln -sf \"$PWD/async.zsh\" \"$PURE_DEST/async\"", - "postinstall-fail-instructions": "echo \"ERROR: Could not automagically symlink the prompt. Either:\\n1. Check out the readme on how to do it manually: https://github.com/sindresorhus/pure#manually\\n2. Or add the following to your \\`.zshrc\\`:\\n\\n fpath+=('$PWD/functions')\"" + "postinstall-fail-instructions": "echo \"ERROR: Could not automagically symlink the prompt. Either:\\n1. Check out the readme on how to do it manually: https://github.com/sindresorhus/pure#manually\\n2. Or add the following to your \\`.zshrc\\`:\\n\\n fpath+=('$PWD/functions')\"", + "version": "sed -i '' -e 's/prompt_pure_state\\[version\\]=.*/prompt_pure_state[version]=\"'\"$npm_package_version\"'\"/' pure.zsh" }, "files": [ "pure.zsh", diff --git a/zsh/pure/pure.zsh b/zsh/pure/pure.zsh index 13af9fa..271c1cc 100644 --- a/zsh/pure/pure.zsh +++ b/zsh/pure/pure.zsh @@ -57,7 +57,7 @@ prompt_pure_set_title() { setopt localoptions noshwordsplit # Emacs terminal does not support settings the title. - (( ${+EMACS} )) && return + (( ${+EMACS} || ${+INSIDE_EMACS} )) && return case $TTY in # Don't set title over serial console. @@ -121,6 +121,8 @@ prompt_pure_set_colors() { prompt_pure_preprompt_render() { setopt localoptions noshwordsplit + unset prompt_pure_async_render_requested + # Set color for Git branch/dirty status and change color if dirty checking has been delayed. local git_color=$prompt_pure_colors[git:branch] local git_dirty_color=$prompt_pure_colors[git:dirty] @@ -129,25 +131,30 @@ prompt_pure_preprompt_render() { # Initialize the preprompt array. local -a preprompt_parts + # Username and machine, if applicable. + [[ -n $prompt_pure_state[username] ]] && preprompt_parts+=($prompt_pure_state[username]) + # Set the path. preprompt_parts+=('%F{${prompt_pure_colors[path]}}%~%f') - # Add Git branch and dirty status info. + # Git branch and dirty status info. typeset -gA prompt_pure_vcs_info if [[ -n $prompt_pure_vcs_info[branch] ]]; then - local branch="%F{$git_color}"'${prompt_pure_vcs_info[branch]}' - if [[ -n $prompt_pure_vcs_info[action] ]]; then - branch+="|%F{$prompt_pure_colors[git:action]}"'$prompt_pure_vcs_info[action]'"%F{$git_color}" - fi - preprompt_parts+=("$branch""%F{$git_dirty_color}"'${prompt_pure_git_dirty}%f') + preprompt_parts+=("%F{$git_color}"'${prompt_pure_vcs_info[branch]}'"%F{$git_dirty_color}"'${prompt_pure_git_dirty}%f') + fi + # Git action (for example, merge). + if [[ -n $prompt_pure_vcs_info[action] ]]; then + preprompt_parts+=("%F{$prompt_pure_colors[git:action]}"'$prompt_pure_vcs_info[action]%f') fi # Git pull/push arrows. if [[ -n $prompt_pure_git_arrows ]]; then preprompt_parts+=('%F{$prompt_pure_colors[git:arrow]}${prompt_pure_git_arrows}%f') fi + # Git stash symbol (if opted in). + if [[ -n $prompt_pure_git_stash ]]; then + preprompt_parts+=('%F{$prompt_pure_colors[git:stash]}${PURE_GIT_STASH_SYMBOL:-≡}%f') + fi - # Username and machine, if applicable. - [[ -n $prompt_pure_state[username] ]] && preprompt_parts+=($prompt_pure_state[username]) # Execution time. [[ -n $prompt_pure_cmd_exec_time ]] && preprompt_parts+=('%F{$prompt_pure_colors[execution_time]}${prompt_pure_cmd_exec_time}%f') @@ -186,6 +193,8 @@ prompt_pure_preprompt_render() { } prompt_pure_precmd() { + setopt localoptions noshwordsplit + # Check execution time and store it in a variable. prompt_pure_check_cmd_exec_time unset prompt_pure_cmd_timestamp @@ -253,18 +262,18 @@ prompt_pure_async_vcs_info() { # to be used or configured as the user pleases. zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' use-simple true - # Only export three message variables from `vcs_info`. + # Only export four message variables from `vcs_info`. zstyle ':vcs_info:*' max-exports 3 - # Export branch (%b), Git toplevel (%R), and action (rebase/cherry-pick) (%a). - zstyle ':vcs_info:git*' formats '%b' '%R' + # Export branch (%b), Git toplevel (%R), action (rebase/cherry-pick) (%a) + zstyle ':vcs_info:git*' formats '%b' '%R' '%a' zstyle ':vcs_info:git*' actionformats '%b' '%R' '%a' vcs_info local -A info info[pwd]=$PWD - info[top]=$vcs_info_msg_1_ info[branch]=$vcs_info_msg_0_ + info[top]=$vcs_info_msg_1_ info[action]=$vcs_info_msg_2_ print -r - ${(@kvq)info} @@ -274,11 +283,15 @@ prompt_pure_async_vcs_info() { prompt_pure_async_git_dirty() { setopt localoptions noshwordsplit local untracked_dirty=$1 + local untracked_git_mode=$(command git config --get status.showUntrackedFiles) + if [[ "$untracked_git_mode" != 'no' ]]; then + untracked_git_mode='normal' + fi if [[ $untracked_dirty = 0 ]]; then command git diff --no-ext-diff --quiet --exit-code else - test -z "$(command git status --porcelain --ignore-submodules -unormal)" + test -z "$(GIT_OPTIONAL_LOCKS=0 command git status --porcelain --ignore-submodules -u${untracked_git_mode})" fi return $? @@ -287,11 +300,25 @@ prompt_pure_async_git_dirty() { prompt_pure_async_git_fetch() { setopt localoptions noshwordsplit + local only_upstream=${1:-0} + # Sets `GIT_TERMINAL_PROMPT=0` to disable authentication prompt for Git fetch (Git 2.3+). export GIT_TERMINAL_PROMPT=0 # Set SSH `BachMode` to disable all interactive SSH password prompting. export GIT_SSH_COMMAND="${GIT_SSH_COMMAND:-"ssh"} -o BatchMode=yes" + local -a remote + if ((only_upstream)); then + local ref + ref=$(command git symbolic-ref -q HEAD) + # Set remote to only fetch information for the current branch. + remote=($(command git for-each-ref --format='%(upstream:remotename) %(refname)' $ref)) + if [[ -z $remote[1] ]]; then + # No remote specified for this branch, skip fetch. + return 97 + fi + fi + # Default return code, which indicates Git fetch failure. local fail_code=99 @@ -317,7 +344,13 @@ prompt_pure_async_git_fetch() { fi ' CHLD - command git -c gc.auto=0 fetch >/dev/null & + # Do git fetch and avoid fetching tags or + # submodules to speed up the process. + command git -c gc.auto=0 fetch \ + --quiet \ + --no-tags \ + --recurse-submodules=no \ + $remote &>/dev/null & wait $! || return $fail_code unsetopt monitor @@ -331,15 +364,40 @@ prompt_pure_async_git_arrows() { command git rev-list --left-right --count HEAD...@'{u}' } +prompt_pure_async_git_stash() { + git rev-list --walk-reflogs --count refs/stash +} + +# Try to lower the priority of the worker so that disk heavy operations +# like `git status` has less impact on the system responsivity. +prompt_pure_async_renice() { + setopt localoptions noshwordsplit + + if command -v renice >/dev/null; then + command renice +15 -p $$ + fi + + if command -v ionice >/dev/null; then + command ionice -c 3 -p $$ + fi +} + +prompt_pure_async_init() { + typeset -g prompt_pure_async_inited + if ((${prompt_pure_async_inited:-0})); then + return + fi + prompt_pure_async_inited=1 + async_start_worker "prompt_pure" -u -n + async_register_callback "prompt_pure" prompt_pure_async_callback + async_worker_eval "prompt_pure" prompt_pure_async_renice +} + prompt_pure_async_tasks() { setopt localoptions noshwordsplit # Initialize the async worker. - ((!${prompt_pure_async_init:-0})) && { - async_start_worker "prompt_pure" -u -n - async_register_callback "prompt_pure" prompt_pure_async_callback - typeset -g prompt_pure_async_init=1 - } + prompt_pure_async_init # Update the current working directory of the async worker. async_worker_eval "prompt_pure" builtin cd -q $PWD @@ -355,6 +413,7 @@ prompt_pure_async_tasks() { unset prompt_pure_git_dirty unset prompt_pure_git_last_dirty_check_timestamp unset prompt_pure_git_arrows + unset prompt_pure_git_stash unset prompt_pure_git_fetch_pattern prompt_pure_vcs_info[branch]= prompt_pure_vcs_info[top]= @@ -374,17 +433,18 @@ prompt_pure_async_refresh() { if [[ -z $prompt_pure_git_fetch_pattern ]]; then # We set the pattern here to avoid redoing the pattern check until the - # working three has changed. Pull and fetch are always valid patterns. + # working tree has changed. Pull and fetch are always valid patterns. typeset -g prompt_pure_git_fetch_pattern="pull|fetch" async_job "prompt_pure" prompt_pure_async_git_aliases fi async_job "prompt_pure" prompt_pure_async_git_arrows - # Do not preform `git fetch` if it is disabled or in home folder. + # Do not perform `git fetch` if it is disabled or in home folder. if (( ${PURE_GIT_PULL:-1} )) && [[ $prompt_pure_vcs_info[top] != $HOME ]]; then - # Tell the async worker to do a `git fetch`. - async_job "prompt_pure" prompt_pure_async_git_fetch + zstyle -t :prompt:pure:git:fetch only_upstream + local only_upstream=$((? == 0)) + async_job "prompt_pure" prompt_pure_async_git_fetch $only_upstream fi # If dirty checking is sufficiently fast, @@ -395,6 +455,13 @@ prompt_pure_async_refresh() { # Check check if there is anything to pull. async_job "prompt_pure" prompt_pure_async_git_dirty ${PURE_GIT_UNTRACKED_DIRTY:-1} fi + + # If stash is enabled, tell async worker to count stashes + if zstyle -t ":prompt:pure:git:stash" show; then + async_job "prompt_pure" prompt_pure_async_git_stash + else + unset prompt_pure_git_stash + fi } prompt_pure_check_git_arrows() { @@ -415,10 +482,27 @@ prompt_pure_async_callback() { case $job in \[async]) - # Code is 1 for corrupted worker output and 2 for dead worker. - if [[ $code -eq 2 ]]; then - # Our worker died unexpectedly. - typeset -g prompt_pure_async_init=0 + # Handle all the errors that could indicate a crashed + # async worker. See zsh-async documentation for the + # definition of the exit codes. + if (( code == 2 )) || (( code == 3 )) || (( code == 130 )); then + # Our worker died unexpectedly, try to recover immediately. + # TODO(mafredri): Do we need to handle next_pending + # and defer the restart? + typeset -g prompt_pure_async_inited=0 + async_stop_worker prompt_pure + prompt_pure_async_init # Reinit the worker. + prompt_pure_async_tasks # Restart all tasks. + + # Reset render state due to restart. + unset prompt_pure_async_render_requested + fi + ;; + \[async/eval]) + if (( code )); then + # Looks like async_worker_eval failed, + # rerun async tasks just in case. + prompt_pure_async_tasks fi ;; prompt_pure_async_vcs_info) @@ -449,7 +533,7 @@ prompt_pure_async_callback() { # Git directory. Run the async refresh tasks. [[ -n $info[top] ]] && [[ -z $prompt_pure_vcs_info[top] ]] && prompt_pure_async_refresh - # Always update branch and top-level. + # Always update branch, top-level and stash. prompt_pure_vcs_info[branch]=$info[branch] prompt_pure_vcs_info[top]=$info[top] prompt_pure_vcs_info[action]=$info[action] @@ -490,6 +574,13 @@ prompt_pure_async_callback() { do_render=1 fi ;; + 97) + # No remote available, make sure to clear git arrows if set. + if [[ -n $prompt_pure_git_arrows ]]; then + typeset -g prompt_pure_git_arrows= + do_render=1 + fi + ;; 99|98) # Git fetch failed. ;; @@ -503,6 +594,11 @@ prompt_pure_async_callback() { ;; esac ;; + prompt_pure_async_git_stash) + local prev_stash=$prompt_pure_git_stash + typeset -g prompt_pure_git_stash=$output + [[ $prev_stash != $prompt_pure_git_stash ]] && do_render=1 + ;; esac if (( next_pending )); then @@ -589,25 +685,39 @@ prompt_pure_state_setup() { # Show `username@host` if logged in through SSH. [[ -n $ssh_connection ]] && username='%F{$prompt_pure_colors[user]}%n%f'"$hostname" + # Show `username@host` if inside a container. + prompt_pure_is_inside_container && username='%F{$prompt_pure_colors[user]}%n%f'"$hostname" + # Show `username@host` if root, with username in default color. [[ $UID -eq 0 ]] && username='%F{$prompt_pure_colors[user:root]}%n%f'"$hostname" typeset -gA prompt_pure_state - prompt_pure_state[version]="1.11.0" + prompt_pure_state[version]="1.13.0" prompt_pure_state+=( username "$username" prompt "${PURE_PROMPT_SYMBOL:-❯}" ) } +# Return true if executing inside a Docker or LXC container. +prompt_pure_is_inside_container() { + local -r cgroup_file='/proc/1/cgroup' + [[ -r "$cgroup_file" && "$(< $cgroup_file)" = *(lxc|docker)* ]] \ + || [[ "$container" == "lxc" ]] +} + prompt_pure_system_report() { setopt localoptions noshwordsplit - print - "- Zsh: $($SHELL --version) ($SHELL)" + local shell=$SHELL + if [[ -z $shell ]]; then + shell=$commands[zsh] + fi + print - "- Zsh: $($shell --version) ($shell)" print -n - "- Operating system: " case "$(uname -s)" in Darwin) print "$(sw_vers -productName) $(sw_vers -productVersion) ($(sw_vers -buildVersion))";; - *) print "$(uname -s) ($(uname -v))";; + *) print "$(uname -s) ($(uname -r) $(uname -v) $(uname -m) $(uname -o))";; esac print - "- Terminal program: ${TERM_PROGRAM:-unknown} (${TERM_PROGRAM_VERSION:-unknown})" print -n - "- Tmux: " @@ -619,10 +729,12 @@ prompt_pure_system_report() { print - "- Pure state:" for k v in "${(@kv)prompt_pure_state}"; do - print - " - $k: \`${(q)v}\`" + print - " - $k: \`${(q-)v}\`" done + print - "- zsh-async version: \`${ASYNC_VERSION}\`" print - "- PROMPT: \`$(typeset -p PROMPT)\`" print - "- Colors: \`$(typeset -p prompt_pure_colors)\`" + print - "- TERM: \`$(typeset -p TERM)\`" print - "- Virtualenv: \`$(typeset -p VIRTUAL_ENV_DISABLE_PROMPT)\`" print - "- Conda: \`$(typeset -p CONDA_CHANGEPS1)\`" @@ -681,14 +793,16 @@ prompt_pure_setup() { prompt_pure_colors_default=( execution_time yellow git:arrow cyan + git:stash cyan git:branch 242 git:branch:cached red - git:action 242 + git:action yellow git:dirty 218 host 242 path blue prompt:error red prompt:success magenta + prompt:continuation 242 user 242 user:root default virtualenv 242 @@ -712,10 +826,11 @@ prompt_pure_setup() { PROMPT='%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)' # Prompt turns red if the previous command didn't exit with 0. - PROMPT+='%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f ' + local prompt_indicator='%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f ' + PROMPT+=$prompt_indicator # Indicate continuation prompt by … and use a darker color for it. - PROMPT2='%F{242}%_… %f%(?.%F{magenta}.%F{red})${prompt_pure_state[prompt]}%f ' + PROMPT2='%F{$prompt_pure_colors[prompt:continuation]}… %(1_.%_ .%_)%f'$prompt_indicator # Store prompt expansion symbols for in-place expansion via (%). For # some reason it does not work without storing them in a variable first. diff --git a/zsh/pure/readme.md b/zsh/pure/readme.md index f3eccf7..bf8fc59 100644 --- a/zsh/pure/readme.md +++ b/zsh/pure/readme.md @@ -4,10 +4,33 @@ <img src="screenshot.png" width="864"> +<br> + +--- + +<div align="center"> + <p> + <p> + <sup> + <a href="https://github.com/sponsors/sindresorhus">Sindre Sorhus' open source work is supported by the community</a> + </sup> + </p> + <sup>Special thanks to:</sup> + <br> + <br> + <a href="https://standardresume.co/tech"> + <img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="200"/> + </a> + </p> +</div> + +--- + +<br> ## Overview -Most prompts are cluttered, ugly and slow. I wanted something visually pleasing that stayed out of my way. +Most prompts are cluttered, ugly and slow. We wanted something visually pleasing that stayed out of our way. ### Why? @@ -17,15 +40,14 @@ Most prompts are cluttered, ugly and slow. I wanted something visually pleasing - Indicates when you have unpushed/unpulled `git` commits with up/down arrows. *(Check is done asynchronously!)* - Prompt character turns red if the last command didn't exit with `0`. - Command execution time will be displayed if it exceeds the set threshold. -- Username and host only displayed when in an SSH session. +- Username and host only displayed when in an SSH session or a container. - Shows the current path in the title and the [current folder & command](screenshot-title-cmd.png) when a process is running. - Support VI-mode indication by reverse prompt symbol (Zsh 5.3+). - Makes an excellent starting point for your own custom prompt. - ## Install -Can be installed with `npm` or manually. Requires Git 2.0.0+ and ZSH 5.2+. Older versions of ZSH are known to work, but they are **not** recommended. +Can be installed with `npm` or manually. Requires Git 2.15.2+ and ZSH 5.2+. Older versions of ZSH are known to work, but they are **not** recommended. ### npm @@ -38,14 +60,17 @@ That's it. Skip to [Getting started](#getting-started). ### Manually 1. Clone this repo somewhere. Here we'll use `$HOME/.zsh/pure`. -2. Add the path of the cloned repo to `$fpath` in `$HOME/.zshrc`. ```sh mkdir -p "$HOME/.zsh" git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure" -fpath+=("$HOME/.zsh/pure") ``` +2. Add the path of the cloned repo to `$fpath` in `$HOME/.zshrc`. +```sh +# .zshrc +fpath+=$HOME/.zsh/pure +``` ## Getting started @@ -57,7 +82,6 @@ autoload -U promptinit; promptinit prompt pure ``` - ## Options | Option | Description | Default value | @@ -70,7 +94,17 @@ prompt pure | **`PURE_PROMPT_VICMD_SYMBOL`** | Defines the prompt symbol used when the `vicmd` keymap is active (VI-mode). | `❮` | | **`PURE_GIT_DOWN_ARROW`** | Defines the git down arrow symbol. | `⇣` | | **`PURE_GIT_UP_ARROW`** | Defines the git up arrow symbol. | `⇡` | +| **`PURE_GIT_STASH_SYMBOL`** | Defines the git stash symbol. | `≡` | + +## Zstyle options + +Showing git stash status as part of the prompt is not activated by default. To activate this you'll need to opt in via `zstyle`: + +`zstyle :prompt:pure:git:stash show yes` +You can set Pure to only `git fetch` the upstream branch of the current local branch. In some cases, this can result in faster updates for Git arrows, but for most users, it's better to leave this setting disabled. You can enable it with: + +`zstyle :prompt:pure:git:fetch only_upstream yes` ## Colors @@ -82,6 +116,7 @@ As explained in ZSH's [manual](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-E Colors can be changed by using [`zstyle`](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzutil-Module) with a pattern of the form `:prompt:pure:$color_name` and style `color`. The color names, their default, and what part they affect are: - `execution_time` (yellow) - The execution time of the last command when exceeding `PURE_CMD_MAX_EXEC_TIME`. - `git:arrow` (cyan) - For `PURE_GIT_UP_ARROW` and `PURE_GIT_DOWN_ARROW`. +- `git:stash` (cyan) - For `PURE_GIT_STASH_SYMBOL`. - `git:branch` (242) - The name of the current branch when in a Git repository. - `git:branch:cached` (red) - The name of the current branch when the data isn't fresh. - `git:action` (242) - The current action in progress (cherry-pick, rebase, etc.) when in a Git repository. @@ -89,7 +124,8 @@ Colors can be changed by using [`zstyle`](http://zsh.sourceforge.net/Doc/Release - `host` (242) - The hostname when on a remote machine. - `path` (blue) - The current path, for example, `PWD`. - `prompt:error` (red) - The `PURE_PROMPT_SYMBOL` when the previous command has *failed*. -- `prompt:success` (magenta) - The `PURE_PROMPT_SYMBOL` when the previous command has *succeded*. +- `prompt:success` (magenta) - The `PURE_PROMPT_SYMBOL` when the previous command has *succeeded*. +- `prompt:continuation` (242) - The color for showing the state of the parser in the continuation prompt (PS2). It's the pink part in [this screenshot](https://user-images.githubusercontent.com/147409/70068574-ebc74800-15f8-11ea-84c0-8b94a4b57ff4.png), it appears in the same spot as `virtualenv`. You could for example matching both colors so that Pure has a uniform look. - `user` (242) - The username when on remote machine. - `user:root` (default) - The username when the user is root. - `virtualenv` (242) - The name of the Python `virtualenv` when in use. @@ -97,26 +133,28 @@ Colors can be changed by using [`zstyle`](http://zsh.sourceforge.net/Doc/Release The following diagram shows where each color is applied on the prompt: ``` -┌───────────────────────────────────────────── path -│ ┌────────────────────────────────── git:branch -│ │ ┌─────────────────────────── git:action -| | | ┌─────────────────── git:dirty -│ │ │ │ ┌───────────────── git:arrow -│ │ │ │ │ ┌──────── host -│ │ │ │ │ │ -~/dev/pure master|rebase-i* ⇡ zaphod@heartofgold 42s -venv ❯ │ │ -│ │ │ └───── execution_time -│ │ └──────────────────────── user +┌────────────────────────────────────────────────────── user +│ ┌─────────────────────────────────────────────── host +│ │ ┌─────────────────────────────────── path +│ │ │ ┌──────────────────────── git:branch +│ │ │ │ ┌────────────────── git:dirty +│ │ │ │ │ ┌──────────────── git:action +│ │ │ │ │ │ ┌─────── git:arrow +│ │ │ │ │ │ │ ┌───── git:stash +│ │ │ │ │ │ │ │ ┌─── execution_time +│ │ │ │ │ │ │ │ │ +zaphod@heartofgold ~/dev/pure master* rebase-i ⇡ ≡ 42s +venv ❯ +│ │ │ └───────────────────────────────────────────────── prompt -└────────────────────────────────────────────────────── virtualenv +└────────────────────────────────────────────────────── virtualenv (or prompt:continuation) ``` ### RGB colors There are two ways to use RGB colors with the hexadecimal format. The correct way is to use a [terminal that support 24-bit colors](https://gist.github.com/XVilka/8346728) and enable this feature as explained in the terminal's documentation. -If you can't use such terminal, the module [`zsh/nearcolor`](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fnearcolor-Module) can be useful. It will map any hexadecimal color to the nearest color in the 88 or 256 color palettes of your termial, but without using the first 16 colors, since their values can be modified by the user. Keep in mind that when using this module you won't be able to display true RGB colors. It only allows you to specify colors in a more convenient way. The following is an example on how to use this module: +If you can't use such terminal, the module [`zsh/nearcolor`](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fnearcolor-Module) can be useful. It will map any hexadecimal color to the nearest color in the 88 or 256 color palettes of your terminal, but without using the first 16 colors, since their values can be modified by the user. Keep in mind that when using this module you won't be able to display true RGB colors. It only allows you to specify colors in a more convenient way. The following is an example on how to use this module: ```sh # .zshrc @@ -124,7 +162,6 @@ zmodload zsh/nearcolor zstyle :prompt:pure:path color '#FF0000' ``` - ## Example ```sh @@ -141,10 +178,12 @@ zstyle :prompt:pure:path color white # change the color for both `prompt:success` and `prompt:error` zstyle ':prompt:pure:prompt:*' color cyan +# turn on git stash status +zstyle :prompt:pure:git:stash show yes + prompt pure ``` - ## Tips In the screenshot you see Pure running in [Hyper](https://hyper.is) with the [hyper-snazzy](https://github.com/sindresorhus/hyper-snazzy) theme and Menlo font. @@ -154,7 +193,6 @@ The [Tomorrow Night Eighties](https://github.com/chriskempson/tomorrow-theme) th To have commands colorized as seen in the screenshot, install [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting). - ## Integration ### [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) @@ -173,9 +211,7 @@ Add `prompt pure` to your `~/.zpreztorc`. ### [zim](https://github.com/Eriner/zim) -Pure is bundled with Zim. No need to install it. - -Set `zprompt_theme='pure'` in `~/.zimrc`. +Add `zmodule sindresorhus/pure --source async.zsh --source pure.zsh` to your `.zimrc` and run `zimfw install`. ### [antigen](https://github.com/zsh-users/antigen) @@ -204,28 +240,27 @@ zplug mafredri/zsh-async, from:github zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme ``` -### [zplugin](https://github.com/zdharma/zplugin) +### [zinit](https://github.com/zdharma/zinit) Update your `.zshrc` file with the following two lines (order matters): ```sh -zplugin ice pick"async.zsh" src"pure.zsh" -zplugin light sindresorhus/pure +zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' +zinit light sindresorhus/pure ``` - ## FAQ There are currently no FAQs. See [FAQ Archive](https://github.com/sindresorhus/pure/wiki/FAQ-Archive) for previous FAQs. - ## Ports - **ZSH** - [therealklanni/purity](https://github.com/therealklanni/purity) - More compact current working directory, important details on the main prompt line, and extra Git indicators. - [intelfx/pure](https://github.com/intelfx/pure) - Solarized-friendly colors, highly verbose, and fully async Git integration. + - [forivall/pure](https://github.com/forivall/pure) - A minimal fork which highlights the Git repo's root directory in the path. - [dfurnes/purer](https://github.com/dfurnes/purer) - Compact single-line prompt with built-in Vim-mode indicator. - [chabou/pure-now](https://github.com/chabou/pure-now) - Fork with [Now](https://zeit.co/now) support. - [pure10k](https://gist.github.com/romkatv/7cbab80dcbc639003066bb68b9ae0bbf) - Configuration file for [Powerlevel10k](https://github.com/romkatv/powerlevel10k/) that makes it look like Pure. @@ -241,9 +276,8 @@ See [FAQ Archive](https://github.com/sindresorhus/pure/wiki/FAQ-Archive) for pre - **PowerShell** - [nickcox/pure-pwsh](https://github.com/nickcox/pure-pwsh/) - PowerShell/PS Core implementation of the Pure prompt. - ## Team -[![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](http://sindresorhus.com) | [![Mathias Fredriksson](https://github.com/mafredri.png?size=100)](https://github.com/mafredri) +[![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](https://sindresorhus.com) | [![Mathias Fredriksson](https://github.com/mafredri.png?size=100)](https://github.com/mafredri) ---|--- [Sindre Sorhus](https://github.com/sindresorhus) | [Mathias Fredriksson](https://github.com/mafredri) diff --git a/zsh/zshrc b/zsh/zshrc index 50cf88f..07c2408 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,8 +1,8 @@ # Functions Autoloading -fpath=(~/.zsh $fpath) +fpath+=(~/.zsh $fpath) # Prompt -autoload -U promptinit && promptinit +autoload -U promptinit; promptinit prompt pure # See: https://github.com/sindresorhus/pure/wiki/Customizations,-hacks-and-tweaks#show-number-of-jobs-in-prompt PROMPT='%(1j.[%j] .)%(?.%F{magenta}.%F{red})${PURE_PROMPT_SYMBOL:-❯}%f ' -- 2.30.0
Thanks!
Signed-off-by: William Durand <will+git@drnd.me> --- git/gitconfig | 132 +++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/git/gitconfig b/git/gitconfig index 2fc0edd..2f03715 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -1,115 +1,115 @@ [user] - name = William Durand - email = will+git@drnd.me + name = William Durand + email = will+git@drnd.me signingkey = 4487A558086115CC! [color] - ui = auto - branch = auto - diff = auto - status = auto + ui = auto + branch = auto + diff = auto + status = auto [color "branch"] - current = yellow reverse - local = yellow - remote = green + current = yellow reverse + local = yellow + remote = green [color "diff"] - meta = yellow - frag = magenta - old = red - new = green + meta = yellow + frag = magenta + old = red + new = green [color "status"] - added = green - changed = yellow - untracked = red + added = green + changed = yellow + untracked = red [core] - ui = true - editor = vim - autocrlf = input - whitespace = trailing-space,space-before-tab - excludesfile = ~/.gitignore_global + ui = true + editor = vim + autocrlf = input + whitespace = trailing-space,space-before-tab + excludesfile = ~/.gitignore_global [diff "exif"] - textconv = exiftool + textconv = exiftool [merge] - tool = vimdiff + tool = vimdiff [help] - autocorrect = 1 + autocorrect = 1 [apply] - whitespace = fix + whitespace = fix [github] - user = willdurand + user = willdurand [alias] - ci = ci-status -v - lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative - fixup = commit --fixup - rebase-i = rebase -i --autosquash --autostash - cleanup = !git branch --merged | grep -v master | xargs git branch -d - next = !git checkout master && hub sync && git cleanup && npx git-delete-squashed - wip = !git commit -am "wip" && git next - rebase-on-top = ! \ - CURRENT_BRANCH_TO_REBASE=$(git rev-parse --abbrev-ref HEAD) && \ - BASE_BRANCH=$1 && shift && \ - echo "==\\> Rebasing $CURRENT_BRANCH_TO_REBASE on top of $BASE_BRANCH" && \ - git rebase --onto ${BASE_BRANCH} ${CURRENT_BRANCH_TO_REBASE}^ ${CURRENT_BRANCH_TO_REBASE} && \ - echo "==\\> done 🚀" - share = !rm -f /tmp/git.diff && git diff | vim - +'w /tmp/git.diff' - todo = grep -A 1 -i --heading "TODO:" - status = status --no-ahead-behind + ci = ci-status -v + lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative + fixup = commit --fixup + rebase-i = rebase -i --autosquash --autostash + cleanup = !git branch --merged | grep -v master | xargs git branch -d + next = !git checkout master && hub sync && git cleanup && npx git-delete-squashed + wip = !git commit -am "wip" && git next + rebase-on-top = ! \ + CURRENT_BRANCH_TO_REBASE=$(git rev-parse --abbrev-ref HEAD) && \ + BASE_BRANCH=$1 && shift && \ + echo "==\\> Rebasing $CURRENT_BRANCH_TO_REBASE on top of $BASE_BRANCH" && \ + git rebase --onto ${BASE_BRANCH} ${CURRENT_BRANCH_TO_REBASE}^ ${CURRENT_BRANCH_TO_REBASE} && \ + echo "==\\> done 🚀" + share = !rm -f /tmp/git.diff && git diff | vim - +'w /tmp/git.diff' + todo = grep -A 1 -i --heading "TODO:" + status = status --no-ahead-behind [hub] - protocol = git + protocol = git [push] - default = current + default = current [pull] - rebase = merges + rebase = merges [commit] - gpgsign = 1 + gpgsign = 1 [sendemail] - smtpencryption = tls - smtpserver = smtp.fastmail.com - smtpserverport = 587 - suppresscc = self - smtpuser = willdurand@fastmail.com - annotate = yes + smtpencryption = tls + smtpserver = smtp.fastmail.com + smtpserverport = 587 + suppresscc = self + smtpuser = willdurand@fastmail.com + annotate = yes [pager] - diff = diff-highlight | less - log = diff-highlight | less - show = diff-highlight | less + diff = diff-highlight | less + log = diff-highlight | less + show = diff-highlight | less [diff] - compactionHeuristic = 1 + compactionHeuristic = 1 [filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true [instaweb] - local = true - httpd=webrick - port=4000 - browser=open + local = true + httpd=webrick + port=4000 + browser=open [rerere] - enabled = true + enabled = true [credential] - helper = osxkeychain + helper = osxkeychain [cinnabar] helper = /usr/local/Cellar/git-cinnabar/0.5.5/libexec/git-cinnabar-helper -- 2.30.0
Thanks!