bin/git-histedit

Tue, 10 Mar 2020 18:32:36 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Tue, 10 Mar 2020 18:32:36 -0400
changeset 851
b8501cb649b6
parent 798
d690f45fd713
permissions
-rwxr-xr-x

automatically try to pick up local::lib

755
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #!/bin/sh
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 set -eu
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 case ${1:-} in *help|-h)
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 exec perldoc -T $0;;
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 esac
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7
798
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
8 BRANCH="$(git symbolic-ref --short -q HEAD)"
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
9 BASE=$(git merge-base "@{u}" "$BRANCH")
755
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10
798
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
11 exec git rebase --interactive --autosquash "$@" "$BASE" "$BRANCH"
755
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 :<<=cut
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 =head1 NAME
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 git histedit
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 =head1 SYNOPSIS
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
19
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
20 $ git histedit
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
22 =head1 DESCRIPTION
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
23
798
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
24 C<histedit> lets you edit the current branch using interactive rebase, but
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
25 without actually I<moving> the fork point of your branch, avoiding the
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
26 complications of fixing up your history and dealing with merge conflicts at the
d690f45fd713 simplify - there's no need to handle other branches or moves in this
Meredith Howard <mhoward@roomag.org>
parents: 759
diff changeset
27 same time.
755
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29 See also: C<hg histedit>
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30
60ee3259bc01 add git-histedit
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
31 =cut

mercurial