From 29d9faa20b146e5313a6cb223869bb3444994c4a Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Tue, 26 Dec 2023 21:18:49 +0100 Subject: [PATCH] git: add gerrit-clone, new aliases --- .gitconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitconfig b/.gitconfig index ee18805..318dcc8 100644 --- a/.gitconfig +++ b/.gitconfig @@ -37,13 +37,14 @@ sl = branchless smartlog sync = branchless sync sw = branchless switch s = branchless switch -i -n = branchless switch -d main +new = !git fetch -u origin main:main && git branchless switch -d origin/main + +gerrit-clone = "!f() { git clone ssh://gerrit-ssh.shelman.io:2222/$1 && (cd $1 && mkdir -p `git rev-parse --git-dir`/hooks/ && scp -O -P 2222 gerrit-ssh.shelman.io:hooks/commit-msg `git rev-parse --git-dir`/hooks/commit-msg && chmod +x `git rev-parse --git-dir`/hooks/commit-msg && git branchless init); }; f" -gerrit-new = !git fetch origin main && git checkout --detach origin/main gerrit-push = !git push origin HEAD:refs/for/main gerrit-push-wip = !git push origin HEAD:refs/for/main%wip gerrit-push-ready = !git push origin HEAD:refs/for/main%ready -gerrit-replace = !git commit --amend -a && git push origin HEAD:refs/for/main +gerrit-replace = !git branchless amend && git push origin HEAD:refs/for/main gerrit-config = !git fetch origin refs/meta/config:refs/remotes/origin/meta/config && git checkout FETCH_HEAD gerrit-config-push = !git push origin HEAD:refs/meta/config gp = gerrit-push