diff options
| author | Stefan Monnier | 2022-09-25 16:15:16 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-09-25 16:15:16 -0400 |
| commit | 650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch) | |
| tree | 85d11f6437cde22f410c25e0e5f71a3131ebd07d /admin/notes/git-workflow | |
| parent | 8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff) | |
| parent | 4b85ae6a24380fb67a3315eaec9233f17a872473 (diff) | |
| download | emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip | |
Merge 'master' into noverlay
Diffstat (limited to 'admin/notes/git-workflow')
| -rw-r--r-- | admin/notes/git-workflow | 47 |
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 | ||
| 2 | neither git-new-workdir nor merge-changelog are in the Emacs | ||
| 3 | distribution yet.) | ||
| 4 | |||
| 5 | Setting up and using git for normal, simple bugfixing | 1 | Setting up and using git for normal, simple bugfixing |
| 6 | ===================================================== | 2 | ===================================================== |
| 7 | 3 | ||
| @@ -12,22 +8,22 @@ git config --global user.email "fchu@example.com" | |||
| 12 | git config --global transfer.fsckObjects true | 8 | git 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] |
| 16 | for more details about why that last line is there.) | 12 | for more details about why that last line is there.) |
| 17 | 13 | ||
| 18 | Initial setup | 14 | Initial setup |
| 19 | ============= | 15 | ============= |
| 20 | 16 | ||
| 21 | Then we want to clone the repository. We normally want to have both | 17 | Then we want to clone the repository. We normally want to have both |
| 22 | the current master and the emacs-26 branch. | 18 | the current master and (if there is one) the active release branch |
| 19 | (eg emacs-28). | ||
| 23 | 20 | ||
| 24 | mkdir ~/emacs | 21 | mkdir ~/emacs |
| 25 | cd ~/emacs | 22 | cd ~/emacs |
| 26 | git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master | 23 | git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master |
| 27 | (cd master; git config push.default current) | 24 | cd master |
| 28 | ./master/admin/git-new-workdir master emacs-26 | 25 | git config push.default current |
| 29 | cd emacs-26 | 26 | git worktree add ../emacs-28 emacs-28 |
| 30 | git checkout emacs-26 | ||
| 31 | 27 | ||
| 32 | You now have both branches conveniently accessible, and you can do | 28 | You 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 | |||
| 57 | as described in ../../CONTRIBUTE. | 53 | as described in ../../CONTRIBUTE. |
| 58 | 54 | ||
| 59 | 55 | ||
| 60 | Backporting to emacs-26 | 56 | Backporting to release branch |
| 61 | ======================= | 57 | ============================= |
| 62 | 58 | ||
| 63 | If you have applied a fix to the master, but then decide that it should | 59 | If you have applied a fix to the master, but then decide that it should |
| 64 | be applied to the emacs-26 branch, too, then | 60 | be applied to the release branch, too, then |
| 65 | 61 | ||
| 66 | cd ~/emacs/master | 62 | cd ~/emacs/master |
| 67 | git log | 63 | git log |
| @@ -71,7 +67,7 @@ which will look like | |||
| 71 | 67 | ||
| 72 | commit 958b768a6534ae6e77a8547a56fc31b46b63710b | 68 | commit 958b768a6534ae6e77a8547a56fc31b46b63710b |
| 73 | 69 | ||
| 74 | cd ~/emacs/emacs-26 | 70 | cd ~/emacs/emacs-28 |
| 75 | git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b | 71 | git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b |
| 76 | 72 | ||
| 77 | and add "Backport:" to the commit string. Then | 73 | and add "Backport:" to the commit string. Then |
| @@ -79,17 +75,28 @@ and add "Backport:" to the commit string. Then | |||
| 79 | git push | 75 | git push |
| 80 | 76 | ||
| 81 | 77 | ||
| 82 | Merging emacs-26 to the master | 78 | Reverting on release branch |
| 83 | ============================== | 79 | =========================== |
| 80 | |||
| 81 | If a commit is made to the release branch, and then it is later | ||
| 82 | decided that this change should only be on the master branch, the | ||
| 83 | simplest way to handle this is to revert the commit on the release | ||
| 84 | branch, and include in the associated log entry "do not merge to master". | ||
| 85 | (Otherwise, the reversion may get merged to master, and inadvertently | ||
| 86 | clobber the change on master if it has been manually made there.) | ||
| 87 | |||
| 88 | |||
| 89 | Merging release branch to the master | ||
| 90 | ==================================== | ||
| 84 | 91 | ||
| 85 | It is recommended to use the file gitmerge.el in the admin directory | 92 | It is recommended to use the file gitmerge.el in the admin directory |
| 86 | for merging 'emacs-26' into 'master'. It will take care of many | 93 | for merging the release branch into 'master'. It will take care of many |
| 87 | things which would otherwise have to be done manually, like ignoring | 94 | things which would otherwise have to be done manually, like ignoring |
| 88 | commits that should not land in master, fixing up ChangeLogs and | 95 | commits that should not land in master, fixing up ChangeLogs and |
| 89 | automatically dealing with certain types of conflicts. If you really | 96 | automatically dealing with certain types of conflicts. If you really |
| 90 | want to, you can do the merge manually, but then you're on your own. | 97 | want to, you can do the merge manually, but then you're on your own. |
| 91 | If you still choose to do that, make absolutely sure that you *always* | 98 | If you still choose to do that, make absolutely sure that you *always* |
| 92 | use the 'merge' command to transport commits from 'emacs-26' to | 99 | use 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 |
| 94 | shouldn't manually do the merge in the first place; just use | 101 | shouldn't manually do the merge in the first place; just use |
| 95 | gitmerge.el instead. | 102 | gitmerge.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 | ||
| 104 | You'll be asked for the branch to merge, which will default to | 111 | You'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 |
| 106 | branch is discouraged, since it might not be up-to-date, or worse, | 113 | branch is discouraged, since it might not be up-to-date, or worse, |
| 107 | contain commits from you which are not yet pushed upstream. | 114 | contain commits from you which are not yet pushed upstream. |
| 108 | 115 | ||
| 109 | You will now see the list of commits from 'emacs-26' which are not yet | 116 | You will now see the list of commits from the release branch that are not yet |
| 110 | merged to 'master'. You might also see commits that are already | 117 | merged to 'master'. You might also see commits that are already |
| 111 | marked for "skipping", which means that they will be merged with a | 118 | marked for "skipping", which means that they will be merged with a |
| 112 | different merge strategy ('ours'), which will effectively ignore the | 119 | different merge strategy ('ours'), which will effectively ignore the |