From 1fab349ff427620855227a79a370782b518e2494 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Sat, 13 Apr 2024 14:31:56 -0400 Subject: [PATCH] add git-gone alias Signed-off-by: ahuston-0 --- users/alice/home/git.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/users/alice/home/git.nix b/users/alice/home/git.nix index 2cd9f89..f0e83f4 100644 --- a/users/alice/home/git.nix +++ b/users/alice/home/git.nix @@ -14,11 +14,15 @@ }; userEmail = "aliceghuston@gmail.com"; userName = "ahuston-0"; - includes.config.contents = { - alias = { - gone = - !"git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"; - }; + aliases = { + gone = '' + !git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | # dump all branches + awk '$2 == "[gone]" {print $1}' | # get nuked branches + sed 's/\\x27/\\x5C\\x27/' | # remove single quotes, for xargs reasons + xargs -r git branch -D # nuke the branches + ''; + }; + extraConfig = { push.autosetupremote = true; pull.rebase = true; color.ui = true;