@@ -5,18 +5,18 @@ eval $(
55 zz_args " Automatically handles non-interactive rebasing with conflict resolution" $0 " $@ " << -help
66 f - force allow overwriting pushed history
77 p - push push to remote after rebase
8- a - auto fully automatic mode - no prompts
8+ a - autosquash Apply autosquash (default: off)
99 n - no-lock don't automatically manage lock files
1010 s strategy strategy strategy for conflicts (default: theirs)
1111 o onto onto rebase onto (default: origin/main)
12- - sha sha commit/ branch to rebase onto (default: origin/main )
13- - branch branch alias for sha
12+ b branch branch branch to rebase (default: current branch )
13+ - sha sha commit/branch to rebase onto (default: origin/main)
1414help
1515)
1616
1717# Set defaults
1818strategy=" ${strategy:- theirs} "
19- sha=" ${ sha:- origin / main} "
19+ sha=$( git getcommit $force $ sha)
2020lockfile_patterns=" ${no_lock: +}${no_lock:- package-lock.json yarn.lock composer.lock pnpm-lock.yaml go.sum} "
2121
2222# Navigate to repository root and validate state
@@ -59,7 +59,7 @@ current_branch=$(git branch --show-current)
5959zz_log i " Rebasing '$current_branch ' onto '$sha ' with '$strategy ' strategy"
6060
6161# Perform rebase with automatic conflict resolution
62- if ! git rebase --strategy-option=" $strategy " --autosquash --autostash --reschedule-failed-exec --exec ' git hook run --ignore-missing pre-commit -- HEAD HEAD~1 && git commit --amend --no-edit --no-verify' --no-verify ${onto: +--onto " $onto " } " $sha " " $branch " ; then
62+ if ! git rebase --strategy-option=" $strategy " ${auto : + --autosquash} --autostash --reschedule-failed-exec --exec ' git hook run --ignore-missing pre-commit -- HEAD HEAD~1 && git commit --amend --no-edit --no-verify' --no-verify ${onto: +--onto " $onto " } " $sha " " $branch " ; then
6363 zz_log w " Resolving conflicts automatically..."
6464
6565 attempts=0
0 commit comments