diff options
author | Ben Sima <ben@bsima.me> | 2023-10-10 13:31:58 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2023-10-10 13:31:58 -0400 |
commit | 83ea1cdd1fbd9c3ae7908ff1dd12363fee585b45 (patch) | |
tree | 6377968ef1b4a41f10ce854eef1b50347405edba /Biz/Ide | |
parent | 39481b42c19f91ee714987176937c089d2c170cb (diff) |
Add git-branchless
After using this for a while, I've decided that git-branchless will be the
default tool for doing trunk-based development in the omnirepo.
Diffstat (limited to 'Biz/Ide')
-rwxr-xr-x | Biz/Ide/hooks/post-applypatch.bash | 6 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-checkout.bash | 4 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-commit.bash | 6 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-merge.bash | 4 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-rewrite.bash | 6 | ||||
-rwxr-xr-x | Biz/Ide/hooks/pre-auto-gc.bash | 6 | ||||
-rwxr-xr-x | Biz/Ide/hooks/reference-transaction.bash | 12 |
7 files changed, 44 insertions, 0 deletions
diff --git a/Biz/Ide/hooks/post-applypatch.bash b/Biz/Ide/hooks/post-applypatch.bash new file mode 100755 index 0000000..5071dc5 --- /dev/null +++ b/Biz/Ide/hooks/post-applypatch.bash @@ -0,0 +1,6 @@ +#!/bin/sh +## START BRANCHLESS CONFIG + +git branchless hook post-applypatch "$@" + +## END BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/post-checkout.bash b/Biz/Ide/hooks/post-checkout.bash index 73488b0..982cb4b 100755 --- a/Biz/Ide/hooks/post-checkout.bash +++ b/Biz/Ide/hooks/post-checkout.bash @@ -13,3 +13,7 @@ then $mktags $changed fi direnv reload +## START BRANCHLESS CONFIG + +git branchless hook post-checkout "$@" +## END BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/post-commit.bash b/Biz/Ide/hooks/post-commit.bash new file mode 100755 index 0000000..cd1f195 --- /dev/null +++ b/Biz/Ide/hooks/post-commit.bash @@ -0,0 +1,6 @@ +#!/bin/sh +## START BRANCHLESS CONFIG + +git branchless hook post-commit "$@" + +## END BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/post-merge.bash b/Biz/Ide/hooks/post-merge.bash index c21211f..94f0f60 100755 --- a/Biz/Ide/hooks/post-merge.bash +++ b/Biz/Ide/hooks/post-merge.bash @@ -1,2 +1,6 @@ #!/usr/bin/env bash exec ${CODEROOT:?}/Biz/Ide/hooks/post-checkout 'HEAD@{1}' HEAD +## START BRANCHLESS CONFIG + +git branchless hook post-merge "$@" +## END BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/post-rewrite.bash b/Biz/Ide/hooks/post-rewrite.bash new file mode 100755 index 0000000..8b3237a --- /dev/null +++ b/Biz/Ide/hooks/post-rewrite.bash @@ -0,0 +1,6 @@ +#!/bin/sh +## START BRANCHLESS CONFIG + +git branchless hook post-rewrite "$@" + +## END BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/pre-auto-gc.bash b/Biz/Ide/hooks/pre-auto-gc.bash new file mode 100755 index 0000000..c92a844 --- /dev/null +++ b/Biz/Ide/hooks/pre-auto-gc.bash @@ -0,0 +1,6 @@ +#!/bin/sh +## START BRANCHLESS CONFIG + +git branchless hook pre-auto-gc "$@" + +## END BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/reference-transaction.bash b/Biz/Ide/hooks/reference-transaction.bash new file mode 100755 index 0000000..ea0cce6 --- /dev/null +++ b/Biz/Ide/hooks/reference-transaction.bash @@ -0,0 +1,12 @@ +#!/bin/sh +## START BRANCHLESS CONFIG + +# Avoid canceling the reference transaction in the case that `branchless` fails +# for whatever reason. +git branchless hook reference-transaction "$@" || ( +echo 'branchless: Failed to process reference transaction!' +echo 'branchless: Some events (e.g. branch updates) may have been lost.' +echo 'branchless: This is a bug. Please report it.' +) + +## END BRANCHLESS CONFIG |