git-sync supports jj
So much nicer!
This commit is contained in:
parent
d2dbb5bbde
commit
a7e2b49bea
|
@ -17,10 +17,18 @@ in
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
cd "${r.path}"
|
cd "${r.path}"
|
||||||
${pkgs.git}/bin/git --no-optional-locks diff --quiet || echo "Repository is dirty!"
|
if [ -d .jj ]
|
||||||
${pkgs.git}/bin/git pull || true
|
then
|
||||||
# Only push if there's something to push. Also prevents from trying to push on repos where we don't have rights.
|
jj git fetch
|
||||||
(${pkgs.git}/bin/git --no-optional-locks status --porcelain -b --ignore-submodules | grep ' \[ahead [0-9]\+\]' && ${pkgs.git}/bin/git push) || true
|
jj rebase -d main@origin
|
||||||
|
jj branch set main -r @-
|
||||||
|
jj git push
|
||||||
|
else
|
||||||
|
${pkgs.git}/bin/git --no-optional-locks diff --quiet || echo "Repository is dirty!"
|
||||||
|
${pkgs.git}/bin/git pull || true
|
||||||
|
# Only push if there's something to push. Also prevents from trying to push on repos where we don't have rights.
|
||||||
|
(${pkgs.git}/bin/git --no-optional-locks status --porcelain -b --ignore-submodules | grep ' \[ahead [0-9]\+\]' && ${pkgs.git}/bin/git push) || true
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
'')
|
'')
|
||||||
|
|
Loading…
Reference in a new issue