aboutsummaryrefslogtreecommitdiffstats
path: root/admin/notes/git-workflow
diff options
context:
space:
mode:
authorKen Raeburn2015-11-01 01:42:21 -0400
committerKen Raeburn2015-11-01 01:42:21 -0400
commit39372e1a1032521be74575bb06f95a3898fbae30 (patch)
tree754bd242a23d2358ea116126fcb0a629947bd9ec /admin/notes/git-workflow
parent6a3121904d76e3b2f63007341d48c5c1af55de80 (diff)
parente11aaee266da52937a3a031cb108fe13f68958c3 (diff)
downloademacs-39372e1a1032521be74575bb06f95a3898fbae30.tar.gz
emacs-39372e1a1032521be74575bb06f95a3898fbae30.zip
merge from trunk
Diffstat (limited to 'admin/notes/git-workflow')
-rw-r--r--admin/notes/git-workflow143
1 files changed, 143 insertions, 0 deletions
diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow
new file mode 100644
index 00000000000..3c2c76c8909
--- /dev/null
+++ b/admin/notes/git-workflow
@@ -0,0 +1,143 @@
1(This is a draft. The method here won't actually work yet, because
2neither git-new-workdir nor merge-changelog are in the Emacs
3distribution yet.)
4
5Setting up and using git for normal, simple bugfixing
6=====================================================
7
8If you haven't configured git before you should first do:
9
10git config --global user.name "Frank Chu"
11git config --global user.email "fchu@example.com"
12
13Initial setup
14=============
15
16Then we want to clone the repository. We normally want to have both
17the current trunk and the emacs-24 branch.
18
19mkdir ~/emacs
20cd ~/emacs
21git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git
22mv emacs trunk
23(cd trunk; git config push.default current)
24./trunk/admin/git-new-workdir trunk emacs-24
25cd emacs-24
26git checkout emacs-24
27git config push.default current
28
29You now have both branches conveniently accessible, and you can do
30"git pull" in them once in a while to keep updated.
31
32
33Fixing bugs
34===========
35
36You edit the files in either branch, 'M-x vc-dir', and check in your
37changes. Then you need to push the data to the main repository. This
38will usually fail, since somebody else has pushed other changes in the
39meantime. To fix this, say
40
41git pull --rebase
42
43which will update your repository, and then re-apply your changes on
44top of that. Then say
45
46git push
47
48
49Sending patches
50===============
51
52If you lack push access or would like feedback before pushing a patch,
53you commit your change locally and then send a patch file as a bug report
54as described in ../../CONTRIBUTE.
55
56
57Backporting to emacs-24
58=======================
59
60If you have applied a fix to the trunk, but then decide that it should
61be applied to the emacs-24 branch, too, then
62
63cd ~/emacs/trunk
64git log
65
66and find the commit you're looking for. Then find the commit ID,
67which will look like
68
69commit 958b768a6534ae6e77a8547a56fc31b46b63710b
70
71cd ~/emacs/emacs-24
72git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b
73
74and add "Backport:" to the commit string. Then
75
76git push
77
78
79Merging emacs-24 to trunk/master
80================================
81
82It is recommended to use the file gitmerge.el in the admin directory
83for merging 'emacs-24' into 'master'. It will take care of many
84things which would otherwise have to be done manually, like ignoring
85commits that should not land in master, fixing up ChangeLogs and
86automatically dealing with certain types of conflicts. If you really
87want to, you can do the merge manually, but then you're on your own.
88If you still choose to do that, make absolutely sure that you *always*
89use the 'merge' command to transport commits from 'emacs-24' to
90'master'. *Never* use 'cherry-pick'! If you don't know why, then you
91shouldn't manually do the merge in the first place; just use
92gitmerge.el instead.
93
94How to use gitmerge.el:
95
96Enter the Emacs repository, checkout 'master' and make sure it's
97up-to-date by doing a pull. Then start Emacs with
98
99 emacs -l admin/gitmerge.el -f gitmerge
100
101You'll be asked for the branch to merge, which will default to
102'origin/emacs-24', which you should accept. Merging a local tracking
103branch is discouraged, since it might not be up-to-date, or worse,
104contain commits from you which are not yet pushed upstream.
105
106You will now see the list of commits from 'emacs-24' which are not yet
107merged to 'master'. You might also see commits that are already
108marked for "skipping", which means that they will be merged with a
109different merge strategy ('ours'), which will effectively ignore the
110commit's diff while still being seen as merged, so it won't turn up
111again in future merges. Recognizing these kinds of commits is done
112with a simple regexp searching the log for strings like 'backport' or
113'merge', so you'll probably see false positives as well as false
114negatives. Carefully go through the commits, investigate them by
115hitting 'l', 'd' and 'f', and mark or unmark them for skipping with
116's'. When you're done, hit 'm' to start the merge.
117
118You'll likely get conflicts during the process which cannot be dealt
119with automatically. In that case, the merge will stop and show you
120the list of conflicted files. Resolve those conflicts as usual using
121smerge and restart gitmerge (remember to enter the repository when
122doing that). You don't have to 'add' the resolved files and 'commit'
123the resulting merge, but if you really want to, feel free to do that.
124Note you can also resume gitmerge in a new Emacs session, since the
125current state will be saved to disk.
126
127When everything's done, look hard at the resulting merge. Skipping
128commits requires separate merges, so don't be surprised to see more
129than one merge commit. If you're happy, push.
130
131Warnings about X11 forwarding
132=============================
133
134If you get warnings like
135
136Warning: No xauth data; using fake authentication data for X11 forwarding.
137X11 forwarding request failed on channel 0
138
139when pulling or pushing data, add the following to the start of
140~/.ssh/config:
141
142Host git.sv.gnu.org
143 ForwardX11 no