# HG changeset patch # User Meredith Howard # Date 1571091256 18000 # Node ID d690f45fd713bc063706617c6a10c10d98e5e02b # Parent 41e248a8a6f7e08fd35e66312eaffda2a86891d3 simplify - there's no need to handle other branches or moves in this diff --git a/bin/git-histedit b/bin/git-histedit --- a/bin/git-histedit +++ b/bin/git-histedit @@ -5,19 +5,10 @@ case ${1:-} in *help|-h) exec perldoc -T $0;; esac -UPSTREAM="${1:-@{u}}" -BRANCH="${2:-$(git symbolic-ref --short -q HEAD || echo HEAD)}" - -[ "$#" -ne 0 ] && shift -[ "$#" -ne 0 ] && shift +BRANCH="$(git symbolic-ref --short -q HEAD)" +BASE=$(git merge-base "@{u}" "$BRANCH") -if git merge-base --is-ancestor "$UPSTREAM" "$BRANCH"; then - BASE=$(git rev-parse "$UPSTREAM") -else - BASE=$(git merge-base "$UPSTREAM" "$BRANCH") -fi - -exec git rebase --interactive --autosquash "$BASE" "$BRANCH" "$@" +exec git rebase --interactive --autosquash "$@" "$BASE" "$BRANCH" :<<=cut =head1 NAME @@ -30,9 +21,10 @@ git histedit =head1 DESCRIPTION -C lets you edit a branch using interactive rebase, but without -actually I the fork point of your branch, avoiding the complications of -fixing up your history and dealing with merge conflicts at the same time. +C lets you edit the current branch using interactive rebase, but +without actually I the fork point of your branch, avoiding the +complications of fixing up your history and dealing with merge conflicts at the +same time. See also: C