chiark / gitweb /
git-debrebase: do not bomb on totally ambiguous pseudomerges
[dgit.git] / dgit-nmu-simple.7.pod
1 =head1 NAME
2
3 dgit-nmu-simple - tutorial for DDs wanting to NMU with git
4
5 =head1 INTRODUCTION AND SCOPE
6
7 This tutorial describes how a Debian Developer can do
8 a straightforward NMU
9 of a package in Debian, using dgit.
10
11 This document won't help you decide whether
12 an NMU is a good idea or
13 whether it be well received.
14 The Debian Developers' Reference has some
15 (sometimes questionable) guidance on this.
16
17 Conversely, you do not need to know anything
18 about the usual maintainer's git workflow.
19 If appropriate, you can work on many different packages,
20 making similar changes,
21 without worrying about the individual maintainers' git practices.
22
23 This tutorial only covers changes which
24 can sensibly be expressed as a
25 reasonably small number of linear commits
26 (whether to Debian packaging or to upstream files or both).
27
28 If you want to do a new upstream version,
29 you probably want to do as the maintainer would have done.
30 You'll need to find out what the maintainer's
31 git practices are
32 and 
33 consult the appropriate C<dgit-maint-*(7)> workflow tutorial,
34
35 =head1 SUMMARY
36
37 =over 4
38
39     % dgit clone glibc jessie
40     % cd glibc
41     % git am ~/glibc-security-fix.diff
42     % dch --nmu "Apply upstream's fix for foo bug."
43     % git add debian/changelog && git commit -m"NMU changelog entry"
44     % dpkg-buildpackage -uc -b
45     [ run your tests ]
46     % dch -r && git add debian/changelog && git commit -m"Finalise NMU"
47     % dgit -wgf sbuild -A -c jessie
48     [ final tests on generated .debs ]
49     % dgit -wgf [--delayed=5] push jessie
50     [ enter your gnupg passphrase as prompted ]
51     [ see that push and upload are successful ]
52     [ prepare and email NMU diff (git-diff, git-format-patch) ]
53
54 =back
55
56 =head1 WHAT KIND OF CHANGES AND COMMITS TO MAKE
57
58 When preparing an NMU, the git commits you make on the dgit branch
59 should be simple linear series of commits with good commit messages.
60 The commit messages will be published in various ways,
61 including perhaps being used as the cover messages for
62 generated quilt patches.
63
64 Do not make merge commits.
65 Do not try to rebase to drop patches - if you need to revert a
66 change which is actually a Debian patch,
67 use git-revert.
68
69 If you need to modify a Debian patch,
70 make a new commit which fixes what needs fixing,
71 and explain in the commit message which patch it should be
72 squashed with
73 (perhaps by use of a commit message in C<git rebase --autosquash -i>
74 format).
75
76 (Of course if you have specific instructions from the maintainer,
77 you can follow those instead.
78 But the procedure in this tutorial is legitimate for any maintainer,
79 in the sense that it should generate an upload to which the
80 maintainer cannot reasonably object.)
81
82 =head1 RELEVANT BRANCHES
83
84 dgit clone will put you on a branch like C<dgit/sid>.
85 There is a pseudo-remote called C<dgit> which also contains a branch
86 like C<dgit/sid>, so you do things like
87 C<git diff dgit/dgit/sid>
88 to see what changes you have made.
89
90 =head1 KEEPING YOUR WORKING TREE TIDY
91
92 Don't forget to C<git add> any new files you create.
93 Otherwise git clean
94 (which is requested with the C<-wgf> option in the recipe above)
95 will delete them.
96
97 Many package builds leave dirty git trees.
98 So, commit before building.
99 That way you can use C<git reset --hard>.
100
101 If you follow this approach
102 you don't need to care about the build dirtying the
103 tree.
104 It also means you don't care about the package clean target,
105 which is just as well because many package clean targets are broken.
106
107 =head1 OTHER GIT BRANCHES
108
109 The dgit git history
110 (visible in gitk and git log)
111 is not necessarily related to the maintainer's
112 or upstream's git history (if any).
113
114 If the maintainer has advertised a git repo with
115 Vcs-Git
116 dgit will set up a remote for it,
117 so you can do
118
119 =over 4
120
121     % git fetch vcs-git
122
123 =back
124
125 You can cherry pick changes from there, for example. 
126 Note that the maintainer's git history may not be
127 suitable for use with dgit.
128 For example, it might be a patches-unapplied branch
129 or even contain only a debian/ directory.
130
131 =head1 UPLOADING TO DELAYED
132
133 You can use dgit's I<--delayed> option
134 to upload to the DELAYED queue.
135 However, you should read the warning about this option in dgit(1).
136
137 =head1 SEE ALSO
138
139 dgit(1), dgit(7), dgit-maint-*(7)