summaryrefslogtreecommitdiffstats
path: root/git-rebase-subtree/git-rebase-subtree.man.in
blob: e2679cef193ac265b9728ed419551004a51b5fc3 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH GIT-REBASE-SUBTREE 1 "@PACKAGE_TARNAME@ @PACKAGE_VERSION@" "2007\-11\-02" "@PACKAGE_NAME@ @PACKAGE_VERSION@"
.SH NAME
git\-rebase\-subtree \- rebase set of interdependant git branches
.SH SYNOPSIS
.B "git\-rebase\-subtree"
.I "<origin-branch>"
.I "<master-branch>"
.PP
.B "git\-rebase\-subtree"
.I "\-\-reverse"
.I "<master-branch>"
.I "<master-branch-plus-x>"
.SH DESCRIPTION
So you are tracking some upstream's git repo and maintain your own set
of interdependent feature branches ("branch subtree").
.PP
And you want to keep that "branch subtree" up-to-date in relation to
upstream so it stays sweet, small, and clean, increasing the chances
that upstream will finally pick something up from it.
.PP
Initial situation: Local branch master tracks remote origin.
.PP
Note: Letters A\-Z are branch names, not revs.
.PP
Old tree:
.nf
                        *\-\-F
                       /
    origin=master\-\-A\-\-B\-\-G
                    \\
                     *\-\-D\-\-H
                         \\
                          *\-\-*\-\-K
.fi
.PP
Generate the following configuration using
.IR "git config" :
.nf
  git config --add rebase-subtree.rebase \*qmaster A\*q
  git config --add rebase-subtree.rebase \*qA B\*q
  git config --add rebase-subtree.rebase \*qB F\*q
  git config --add rebase-subtree.rebase \*qB G\*q
  git config --add rebase-subtree.rebase \*qA D\*q
  git config --add rebase-subtree.rebase \*qD H\*q
  git config --add rebase-subtree.rebase \*qD K\*q
.fi
.PP
After "git\-fetch \-v":
.nf
                         *\-\-F
                        /
           master\-\-\-A\-\-B\-\-G
            \\        \\
             *        *\-\-D\-\-H
              \\           \\
               origin'     *\-\-*\-\-K
.fi
.PP
After hypothetical "git\-rebase\-subtree origin master":
.nf
                          *'\-\-F'
                         /
   origin'=master'\-\-A'\-\-B'\-\-G'
                     \\
                      *'\-\-D'\-\-H'
                           \\
                            *'\-\-*'\-\-K'
.fi
.SS "REVERSE OPERATION"
.PP
Old tree:
.nf
                        *\-\-F
                       /
        master\-\-Y\-\-A\-\-B\-\-G
                    \\
                     *\-\-D\-\-H
                         \\
                          *\-\-*\-\-K
.fi
.PP
After hypothetical "git\-rebase\-subtree \-\-reverse master Y":
.nf
                  Y      *'\-\-F'
                 /      /
           master\-\-A'\-\-B'\-\-G'
                    \\
                     *'\-\-D'\-\-H'
                          \\
                           *'\-\-*'\-\-K'
.fi
.SH "GIT CONFIGURATION"
Configuration for
.B "git-rebase-subtree"
only makes sense on a per-repository basis, not on a
.I "--global"
basis.
.TP
.B "rebase-subtree.rebase"
Add a new line to the config option for each
.IR "orig" - "branch"
pair. Each
.B "rebase-subtree.rebase"
option line defines an edge in the branch subtree to rebase.
.TP
.B "rebase-subtree.subtree"
.br
.I "(Deprecated because it is unreadable)"
.br
String of \*qorig branch\norig2 branch2\*q form. Becomes very unreadable
when the branch subtree to rebase contains more than a couple of branches.
Use
.B "rebase-subtree.rebase"
instead.
.SH "NOT BUGS"
.TP
.B "Obsoleted by git 1.5.6"
git 1.5.6 can trigger branch rebases on pulls instead of standard merges.
It cannot rebase entire subtrees, through, neither by manual command nor
automatically.
.SH "BUGS"
.TP
.B "Lacks generality (fixation about 'master')"
Yes.
.TP
.B "Needs complicated config"
Yes. Auto-generating the graph may be possible.
.TP
.B "Needs merge conflict handling"
Definitely. At the moment, it just messes up your branch tree if some
error happens during the rebase.
.TP
.B "Needs proper error handling"
Definitely. Possibly just renaming the
.I rebase-subtree/old/foo
branches to
.I foo
could do the job. Needs more investigation, though.
.TP
.B "Should bail out if old/foo exists and is not equal to foo"
Yes.
.SH "SEE ALSO"
git\-rebase(1).