aboutsummaryrefslogtreecommitdiffstats
path: root/admin/notes/git-workflow
diff options
context:
space:
mode:
authorStefan Monnier2022-09-25 16:15:16 -0400
committerStefan Monnier2022-09-25 16:15:16 -0400
commit650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch)
tree85d11f6437cde22f410c25e0e5f71a3131ebd07d /admin/notes/git-workflow
parent8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff)
parent4b85ae6a24380fb67a3315eaec9233f17a872473 (diff)
downloademacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip
Merge 'master' into noverlay
Diffstat (limited to 'admin/notes/git-workflow')
-rw-r--r--admin/notes/git-workflow47
1 files changed, 27 insertions, 20 deletions
diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow
index cb10638af82..265a106bad5 100644
--- a/admin/notes/git-workflow
+++ b/admin/notes/git-workflow
@@ -1,7 +1,3 @@
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 1Setting up and using git for normal, simple bugfixing
6===================================================== 2=====================================================
7 3
@@ -12,22 +8,22 @@ git config --global user.email "fchu@example.com"
12git config --global transfer.fsckObjects true 8git config --global transfer.fsckObjects true
13 9
14(See the thread "Recommend these .gitconfig settings for git integrity." 10(See the thread "Recommend these .gitconfig settings for git integrity."
15[https://lists.gnu.org/archive/html/emacs-devel/2016-01/threads.html#01802] 11[https://lists.gnu.org/r/emacs-devel/2016-01/threads.html#01802]
16for more details about why that last line is there.) 12for more details about why that last line is there.)
17 13
18Initial setup 14Initial setup
19============= 15=============
20 16
21Then we want to clone the repository. We normally want to have both 17Then we want to clone the repository. We normally want to have both
22the current master and the emacs-26 branch. 18the current master and (if there is one) the active release branch
19(eg emacs-28).
23 20
24mkdir ~/emacs 21mkdir ~/emacs
25cd ~/emacs 22cd ~/emacs
26git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master 23git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master
27(cd master; git config push.default current) 24cd master
28./master/admin/git-new-workdir master emacs-26 25git config push.default current
29cd emacs-26 26git worktree add ../emacs-28 emacs-28
30git checkout emacs-26
31 27
32You now have both branches conveniently accessible, and you can do 28You now have both branches conveniently accessible, and you can do
33"git pull" in them once in a while to keep updated. 29"git pull" in them once in a while to keep updated.
@@ -57,11 +53,11 @@ you commit your change locally and then send a patch file as a bug report
57as described in ../../CONTRIBUTE. 53as described in ../../CONTRIBUTE.
58 54
59 55
60Backporting to emacs-26 56Backporting to release branch
61======================= 57=============================
62 58
63If you have applied a fix to the master, but then decide that it should 59If you have applied a fix to the master, but then decide that it should
64be applied to the emacs-26 branch, too, then 60be applied to the release branch, too, then
65 61
66cd ~/emacs/master 62cd ~/emacs/master
67git log 63git log
@@ -71,7 +67,7 @@ which will look like
71 67
72commit 958b768a6534ae6e77a8547a56fc31b46b63710b 68commit 958b768a6534ae6e77a8547a56fc31b46b63710b
73 69
74cd ~/emacs/emacs-26 70cd ~/emacs/emacs-28
75git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b 71git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b
76 72
77and add "Backport:" to the commit string. Then 73and add "Backport:" to the commit string. Then
@@ -79,17 +75,28 @@ and add "Backport:" to the commit string. Then
79git push 75git push
80 76
81 77
82Merging emacs-26 to the master 78Reverting on release branch
83============================== 79===========================
80
81If a commit is made to the release branch, and then it is later
82decided that this change should only be on the master branch, the
83simplest way to handle this is to revert the commit on the release
84branch, and include in the associated log entry "do not merge to master".
85(Otherwise, the reversion may get merged to master, and inadvertently
86clobber the change on master if it has been manually made there.)
87
88
89Merging release branch to the master
90====================================
84 91
85It is recommended to use the file gitmerge.el in the admin directory 92It is recommended to use the file gitmerge.el in the admin directory
86for merging 'emacs-26' into 'master'. It will take care of many 93for merging the release branch into 'master'. It will take care of many
87things which would otherwise have to be done manually, like ignoring 94things which would otherwise have to be done manually, like ignoring
88commits that should not land in master, fixing up ChangeLogs and 95commits that should not land in master, fixing up ChangeLogs and
89automatically dealing with certain types of conflicts. If you really 96automatically dealing with certain types of conflicts. If you really
90want to, you can do the merge manually, but then you're on your own. 97want to, you can do the merge manually, but then you're on your own.
91If you still choose to do that, make absolutely sure that you *always* 98If you still choose to do that, make absolutely sure that you *always*
92use the 'merge' command to transport commits from 'emacs-26' to 99use the 'merge' command to transport commits from the release branch to
93'master'. *Never* use 'cherry-pick'! If you don't know why, then you 100'master'. *Never* use 'cherry-pick'! If you don't know why, then you
94shouldn't manually do the merge in the first place; just use 101shouldn't manually do the merge in the first place; just use
95gitmerge.el instead. 102gitmerge.el instead.
@@ -102,11 +109,11 @@ up-to-date by doing a pull. Then start Emacs with
102 emacs -l admin/gitmerge.el -f gitmerge 109 emacs -l admin/gitmerge.el -f gitmerge
103 110
104You'll be asked for the branch to merge, which will default to 111You'll be asked for the branch to merge, which will default to
105'origin/emacs-26', which you should accept. Merging a local tracking 112(eg) 'origin/emacs-28', which you should accept. Merging a local tracking
106branch is discouraged, since it might not be up-to-date, or worse, 113branch is discouraged, since it might not be up-to-date, or worse,
107contain commits from you which are not yet pushed upstream. 114contain commits from you which are not yet pushed upstream.
108 115
109You will now see the list of commits from 'emacs-26' which are not yet 116You will now see the list of commits from the release branch that are not yet
110merged to 'master'. You might also see commits that are already 117merged to 'master'. You might also see commits that are already
111marked for "skipping", which means that they will be merged with a 118marked for "skipping", which means that they will be merged with a
112different merge strategy ('ours'), which will effectively ignore the 119different merge strategy ('ours'), which will effectively ignore the