-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
85 lines (57 loc) · 1.67 KB
/
Copy pathREADME
File metadata and controls
85 lines (57 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
git-rebase-diff
===============
a tiny wrapper around git range-diff,
to make it easy to use after performing a rebase
(or multiple rebases, as long as you haven't pushed to a remote branch yet).
esp useful if encountered merge conflicts
& want to verify that nothing screwed up.
see also: https://github.com/kiprasmel/git-diff3c
setup
-----
```
git clone https://github.com/kiprasmel/git-rebase-diff.git
# or: git clone git@github.com:kiprasmel/git-rebase-diff.git
cd git-rebase-diff
cp git-rebase-diff /usr/local/bin/
# optional alias
git config --global alias.rd rebase-diff
```
usage
-----
expects that you:
- are checked out in the branch you rebased
- the branch has a remote counterpart
```
git-rebase-diff
git-rebase-diff [options]...
git-rebase-diff -- [range-diff args]...
```
behavior
--------
essentially does:
```
old=@{u}
new=@
base=$(git merge-base $old $new)
git range-diff $base..$old $base..$new
```
viewing a previous rebase diff
------------------------------
git-rebase-diff --prev 0 # current (no effect)
git-rebase-diff --prev 1 # 1st previous
git-rebase-diff -1 # 1st previous
git-rebase-diff -5 # 5th previous
git-rebase-diff -max # very last
viewing an interval of grouped rebase-diffs
viewing multiple rebase-diffs
---------------------------------------
git-rebase-diff --left 5 # from previous 5th till current
git-rebase-diff --left 5 --right 2 # from previous 5th till previous 2nd
known issues
------------
won't work if you rebased starting from the initial commit (via --root)
see also
--------
- man git-range-diff
- https://stackoverflow.com/a/61219652/9285308
- https://github.com/kiprasmel/git-diff3c