]> code.delx.au - gnu-emacs/blob - admin/notes/repo
4f9dc59eb0f58e0ff7432b4d75b81dabf95fa699
[gnu-emacs] / admin / notes / repo
1 NOTES ON COMMITTING TO EMACS'S REPOSITORY -*- outline -*-
2
3 ** elpa
4
5 This branch does not contain a copy of Emacs, but of the Emacs Lisp
6 package archive (elpa.gnu.org). See admin/notes/elpa for further
7 explanation, and the README file in the branch for usage
8 instructions.
9
10 * Install changes only on one branch, let them get merged elsewhere if needed.
11
12 In particular, install bug-fixes only on the release branch (if there
13 is one) and let them get synced to the trunk; do not install them by
14 hand on the trunk as well. E.g. if there is an active "emacs-24" branch
15 and you have a bug-fix appropriate for the next emacs-24.x release,
16 install it only on the emacs-24 branch, not on the trunk as well.
17
18 Installing things manually into more than one branch makes merges more
19 difficult.
20
21 http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01124.html
22
23 The exception is, if you know that the change will be difficult to
24 merge to the trunk (eg because the trunk code has changed a lot).
25 In that case, it's helpful if you can apply the change to both trunk
26 and branch yourself (when committing the branch change, indicate
27 in the commit log that it should not be merged to the trunk, by
28 including the phrase "Not to be merged to master", or any other phrase
29 that matches "merge").
30
31 * Installing changes from your personal branches.
32
33 If your branch has only a single commit, or many different real
34 commits, it is fine to do a merge. If your branch has only a very
35 small number of "real" commits, but several "merge from trunks", it is
36 preferred that you take your branch's diff, apply it to the trunk, and
37 commit directly, not merge. This keeps the history cleaner.
38
39 In general, when working on some feature in a separate branch, it is
40 preferable not to merge from trunk until you are done with the
41 feature. Unless you really need some change that was done on the
42 trunk while you were developing on the branch, you don't really need
43 those merges; just merge once, when you are done with the feature, and
44 Bazaar will take care of the rest. Bazaar is much better in this than
45 CVS, so interim merges are unnecessary.
46
47 Or use shelves; or rebase; or do something else. See the thread for
48 yet another fun excursion into the exciting world of version control.
49
50 http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00086.html
51
52 * Installing changes from gnulib
53
54 Some of the files in Emacs are copied from gnulib. To synchronize
55 these files from the version of gnulib that you have checked out into
56 a sibling directory of your branch, type "admin/merge-gnulib"; this
57 will check out the latest version of gnulib if there is no sibling
58 directory already. It is a good idea to run "git status" afterwards,
59 so that if a gnulib module added a file, you can record the new file
60 using "git add". After synchronizing from gnulib, do a "make" in the
61 usual way.
62
63 To change the set of gnulib modules, change the GNULIB_MODULES
64 variable in admin/merge-gnulib before running it.
65
66 If you remove a gnulib module, or if a gnulib module
67 removes a file, then remove the corresponding files by hand.
68
69 * How to merge changes from emacs-24 to trunk
70
71 [The section on git merge procedure has not yet been written]
72
73 Inspect the change log entries (e.g. in case too many entries have been
74 included or whitespace between entries needs fixing). If someone made
75 multiple change log entries on different days in the branch, you may
76 wish to collapse them all to a single entry for that author in the
77 trunk (because in the trunk they all appear under the same date).
78 Obviously, if there are multiple changes to the same file by different
79 authors, don't break the logical ordering in doing this.
80
81 You may see conflicts in autoload md5sums in comments. Strictly
82 speaking, the right thing to do is merge everything else, resolve the
83 conflict by choosing either the trunk or branch version, then run
84 `make -C lisp autoloads' to update the md5sums to the correct trunk
85 value before committing.
86
87 * Re-adding a file that has been removed from the repository
88
89 Let's suppose you've done:
90
91 git rm file; git commit -a
92
93 You can just restore a copy of the file and then re-add it;
94 git does not have per-file history so this will not harm
95 anything.
96
97 Alternatively, you can do
98
99 git revert XXXXX
100
101 where XXXXX is the hash of the commit in which file was removed.
102 This backs out the entire changeset the deletion was part of,
103 which is often more appropriate.
104
105 * Undoing a commit (uncommitting)
106
107 If you have not pushed the commit, you may be able to use `git reset
108 --hard' with a hash argument to revert the your local repo copy to the
109 pre-commit state.
110
111 If you have pushed commit, resetting will be ineffective because it
112 will only vanish the commit in your local copy. Instead, use `git
113 revert', giving it the commit ID as argument. This will create a
114 new commit that backs out the change. Then push that.
115
116 Note that git will generate a log message for the revert that includes
117 a git hash. Please edit this to refer to the commit by the first line
118 of its log comment, or by committer and date, or by something else
119 that is not the hash. As noted previously, it is best to avoid hashes
120 in comments in case we someday have to change version-control systems
121 again.
122
123 * Bisecting
124
125 This is a semi-automated way to find the revision that introduced a bug.
126 Browse `git help bisect' for technical instructions.