1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-08 20:58:58 +00:00
emacs/admin/notes/git-workflow
Paul Eggert d20161b25e Merge from origin/emacs-26
a89f0b6f33 maint: shorten https://lists.gnu.org/archive/html/... links
8be3aee281 Merge from Gnulib
265cee553f Work around GCC bug 80776 on Fedora 27 x86
dc7a97fb84 Tweak copy-file, rename-file doc
cfa2a944d4 Change font-lock-extend-region-multiline handling in mhtml...
a8664cc998 Minor cleanup in tramp-gvfs-handle-file-local-copy
55c5b12fa0 Add test for Bug#29423 in Tramp.
3198a1646e Avoid jumbled order in HTML rendered by shr.el
23bfc2d2db Make sure 'dired-filename' property is always put by ls-lisp
f7fdaea4c0 A better solution for bug#29347
86e6ed8521 ; * src/thread.c (acquire_global_lock): Fix thinko in last...
f300852037 Avoid a hang after C-g while sit-for on a Unix TTY
d7fc719ff1 Improve the doc string of 'list-packages'
b4f67ebb92 Improve discoverability of 'defvar' for suppressing warnings
8a2b204e64 Improve discoverability of 'read-buffer-completion-ignore-...
eea4e9194c Improve documentation of self-insert-uses-region-functions
e6e41dac87 Reflect changes in copy-file and rename-file in doc strings
0ec534070f * lisp/progmodes/cc-vars.el (c-offsets-alist): Doc fix.  (...
1d0dbdff6c Reorder type predicates in ELisp manual
b081ec9dd7 Fix backward scrolling in buffers with header-line
8e40429c96 ; Fix some doc typos
ed2c542920 * lisp/bindings.el (buffer-file-coding-system): Add explic...
d82474e452 * src/fns.c (syms_of_fns) <overriding-plist-environment>: ...
292c09ff6d Fix incorrect interaction of drag/drop and double click (b...
d6fadb1d26 * lisp/menu-bar.el (menu-bar-options-save): Add display-li...
daa959efbc * lisp/menu-bar.el (menu-bar-options-save): Add global-dis...
17fc74d1b9 * lisp/follow.el (follow-mode): Restore mode line lighter....
f20c2e2f3d ; Compare process status against 127 exactly
2d203ffb7e Extract the common part of ruby-flymake-simple and ruby-fl...
09944d499a Add Rubocop Flymake backend
c65a0ae7c4 ; Fix a typo
7ab7603125 Update nt/INSTALL.W64 (Bug#28601)
11db253c08 Remove incorrect NEWS item about VC state indicator (Bug#2...
2fdc01c036 * lisp/emacs-lisp/byte-run.el (defsubst): Doc fix.
735c8b516e Make c-defun-name analyze more thoroughly a function type ...
92f0c4cd56 Avoid bogus abbreviated file names if HOME changes
8d450453fa * lisp/emacs-lisp/byte-run.el (inline): Give it a doc.
37a3b4ea40 Fix erc keep-place module with new defaults (Bug#29111)
6c312605bf Add window divider faces to NS (bug#29353)

# Conflicts:
#	etc/NEWS
#	lisp/ruler-mode.el
2017-11-25 22:55:35 -08:00

147 lines
5.0 KiB
Plaintext

(This is a draft. The method here won't actually work yet, because
neither git-new-workdir nor merge-changelog are in the Emacs
distribution yet.)
Setting up and using git for normal, simple bugfixing
=====================================================
If you haven't configured git before you should first do:
git config --global user.name "Frank Chu"
git config --global user.email "fchu@example.com"
git config --global transfer.fsckObjects true
(See the thread "Recommend these .gitconfig settings for git integrity."
[https://lists.gnu.org/r/emacs-devel/2016-01/threads.html#01802]
for more details about why that last line is there.)
Initial setup
=============
Then we want to clone the repository. We normally want to have both
the current master and the emacs-26 branch.
mkdir ~/emacs
cd ~/emacs
git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master
(cd master; git config push.default current)
./master/admin/git-new-workdir master emacs-26
cd emacs-26
git checkout emacs-26
You now have both branches conveniently accessible, and you can do
"git pull" in them once in a while to keep updated.
Fixing bugs
===========
You edit the files in either branch, 'M-x vc-dir', and check in your
changes. Then you need to push the data to the main repository. This
will usually fail, since somebody else has pushed other changes in the
meantime. To fix this, say
git pull --rebase
which will update your repository, and then re-apply your changes on
top of that. Then say
git push
Sending patches
===============
If you lack push access or would like feedback before pushing a patch,
you commit your change locally and then send a patch file as a bug report
as described in ../../CONTRIBUTE.
Backporting to emacs-26
=======================
If you have applied a fix to the master, but then decide that it should
be applied to the emacs-26 branch, too, then
cd ~/emacs/master
git log
and find the commit you're looking for. Then find the commit ID,
which will look like
commit 958b768a6534ae6e77a8547a56fc31b46b63710b
cd ~/emacs/emacs-26
git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b
and add "Backport:" to the commit string. Then
git push
Merging emacs-26 to the master
==============================
It is recommended to use the file gitmerge.el in the admin directory
for merging 'emacs-26' into 'master'. It will take care of many
things which would otherwise have to be done manually, like ignoring
commits that should not land in master, fixing up ChangeLogs and
automatically dealing with certain types of conflicts. If you really
want to, you can do the merge manually, but then you're on your own.
If you still choose to do that, make absolutely sure that you *always*
use the 'merge' command to transport commits from 'emacs-26' to
'master'. *Never* use 'cherry-pick'! If you don't know why, then you
shouldn't manually do the merge in the first place; just use
gitmerge.el instead.
How to use gitmerge.el:
Enter the Emacs repository, checkout 'master' and make sure it's
up-to-date by doing a pull. Then start Emacs with
emacs -l admin/gitmerge.el -f gitmerge
You'll be asked for the branch to merge, which will default to
'origin/emacs-26', which you should accept. Merging a local tracking
branch is discouraged, since it might not be up-to-date, or worse,
contain commits from you which are not yet pushed upstream.
You will now see the list of commits from 'emacs-26' which are not yet
merged to 'master'. You might also see commits that are already
marked for "skipping", which means that they will be merged with a
different merge strategy ('ours'), which will effectively ignore the
commit's diff while still being seen as merged, so it won't turn up
again in future merges. Recognizing these kinds of commits is done
with a simple regexp searching the log for strings like 'backport' or
'merge', so you'll probably see false positives as well as false
negatives. Carefully go through the commits, investigate them by
hitting 'l', 'd' and 'f', and mark or unmark them for skipping with
's'. When you're done, hit 'm' to start the merge.
You'll likely get conflicts during the process which cannot be dealt
with automatically. In that case, the merge will stop and show you
the list of conflicted files. Resolve those conflicts as usual using
smerge and restart gitmerge (remember to enter the repository when
doing that). You don't have to 'add' the resolved files and 'commit'
the resulting merge, but if you really want to, feel free to do that.
Note you can also resume gitmerge in a new Emacs session, since the
current state will be saved to disk.
When everything's done, look hard at the resulting merge. Skipping
commits requires separate merges, so don't be surprised to see more
than one merge commit. If you're happy, push.
Warnings about X11 forwarding
=============================
If you get warnings like
Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0
when pulling or pushing data, add the following to the start of
~/.ssh/config:
Host git.sv.gnu.org
ForwardX11 no