From 1bafe4d3852a2b26aa9f0745c5e09c73ac228a4d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 17 Nov 2024 13:58:39 +0100 Subject: [PATCH] wip --- shell/alias/git.sh | 54 ++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/shell/alias/git.sh b/shell/alias/git.sh index 802813e..cff9961 100644 --- a/shell/alias/git.sh +++ b/shell/alias/git.sh @@ -158,79 +158,88 @@ git_cherry_pick_continue() { gcpc() { git_cherry_pick_continue "${@}"; } # configure the user email -gcue() { +git_config_user_email() { git \ config \ "user.email" \ "${@}" } +gcue() { git_config_user_email "${@}"; } # configure the user name -gcun() { +git_config_user_name() { git \ config \ "user.name" \ "${@}" } +gcun() { git_config_user_name "${@}"; } # differences from last or between commits -gd() { +git_diff() { git \ diff \ "${@}" } +gd() { git_diff "${@}"; } # display what is indexed in cache -gdc() { +git_diff_cached() { git \ diff \ --cached \ "${@}" } +gdc() { git_diff_cached "${@}"; } # indexed character-level differences -gdcw() { +git_diff_cached_word() { git \ diff \ --cached \ --word-diff-regex "." \ "${@}" } +gdcw() { git_diff_cached_word "${@}"; } # differences via external tool -gdt() { +git_diff_tool() { git \ difftool \ --dir-diff \ "${@}" } +gdt() { git_diff_tool "${@}"; } # character-level differences -gdw() { +git_diff_word() { git \ diff \ --word-diff-regex "." \ "${@}" } +gdw() { git_diff_word "${@}"; } # fetch from the remote repository -gf() { +git_fetch() { git \ fetch \ --tags \ --verbose \ "${@}" } +gf() { git_fetch "${@}"; } # fetch from remote repository and prune local orphan branches -gfp() { +git_fetch_prune() { gf \ --prune \ "${@}" } +gfp() { git_fetch_prune "${@}"; } # garbage collect all orphan commits -ggc() { +git_garbage_collect() { git \ reflog \ expire \ @@ -241,24 +250,27 @@ ggc() { --aggressive \ --prune="now" } +ggc() { git_garbage_collect "${@}"; } # initialize a new repository -gi() { +git_init() { git \ init \ "${@}" } +gi() { git_init "${@}"; } # initialize a new bare repository -gib() { +git_init_bare() { git \ init \ --bare \ "${@}" } +gib() { git_init_bare "${@}"; } # log history -gl() { +git_log() { local format="\ %C(auto)%h%d S %C(red)%GS @@ -275,45 +287,51 @@ C %C(blue)%ci --graph \ "${@}" } +gl() { git_log "${@}"; } # log all history -gla() { +git_log_all() { gl \ --all \ "${@}" } +gla() { git_log_all "${@}"; } # log all history with patches -glap() { +git_log_all_patch() { gl \ --all \ --patch \ "${@}" } +glap() { git_log_all_patch "${@}"; } # log history with patches -glp() { +git_log_patch() { gl \ --patch \ "${@}" } +glp() { git_log_patch "${@}"; } # abort the current merge commit -gma() { +git_merge_abort() { git \ merge \ --abort \ "${@}" } +gma() { git_merge_abort "${@}"; } # do a merge commit -gmc() { +git_merge_commit() { git \ merge \ --no-ff \ --message \ "${@}" } +gmc() { git_merge_commit "${@}"; } # fast-forward to remote branch gmf() {