home/git: add rebase-fixups script
This commit is contained in:
parent
a5cad921ff
commit
84c9562bfc
|
@ -54,6 +54,7 @@ in
|
||||||
authors = "shortlog --summary --numbered --email";
|
authors = "shortlog --summary --numbered --email";
|
||||||
si = "switch-interactive";
|
si = "switch-interactive";
|
||||||
ff = "fixup-fixup";
|
ff = "fixup-fixup";
|
||||||
|
rf = "rebase-fixups";
|
||||||
pp = "post-pr";
|
pp = "post-pr";
|
||||||
subs = "submodule update --init --recursive";
|
subs = "submodule update --init --recursive";
|
||||||
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
|
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
|
||||||
|
@ -277,6 +278,11 @@ in
|
||||||
runtimeInputs = with pkgs; [ cfg.package ];
|
runtimeInputs = with pkgs; [ cfg.package ];
|
||||||
text = lib.fileContents ./scripts/git-fixup-fixup.sh;
|
text = lib.fileContents ./scripts/git-fixup-fixup.sh;
|
||||||
})
|
})
|
||||||
|
(pkgs.writeShellApplication {
|
||||||
|
name = "git-rebase-fixups";
|
||||||
|
runtimeInputs = with pkgs; [ cfg.package gnused ];
|
||||||
|
text = lib.fileContents ./scripts/git-rebase-fixups.sh;
|
||||||
|
})
|
||||||
(pkgs.writeShellApplication {
|
(pkgs.writeShellApplication {
|
||||||
name = "git-switch-interactive";
|
name = "git-switch-interactive";
|
||||||
runtimeInputs = with pkgs; [ cfg.package fzf gnused coreutils ];
|
runtimeInputs = with pkgs; [ cfg.package fzf gnused coreutils ];
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
if [ -n "${1:-}" ]; then
|
||||||
|
TARGET_BRANCH="$1"
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
TARGET_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
|
||||||
|
fi
|
||||||
|
|
||||||
|
FORK_POINT=$(git merge-base --fork-point "$TARGET_BRANCH")
|
||||||
|
|
||||||
|
git rebase "$FORK_POINT" --autosquash "$@"
|
Loading…
Reference in New Issue