3 dgit-nmu-simple - tutorial for DDs wanting to NMU with git
5 =head1 INTRODUCTION AND SCOPE
7 This tutorial describes how a Debian Developer can do
9 of a package in Debian, using dgit.
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.
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.
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).
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
33 consult the appropriate C<dgit-maint-*(7)> workflow tutorial,
39 % dgit clone glibc jessie
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
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) ]
56 =head1 WHAT KIND OF CHANGES AND COMMITS TO MAKE
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.
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,
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
73 (perhaps by use of a commit message in C<git rebase --autosquash -i>
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.)
82 =head1 RELEVANT BRANCHES
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.
90 =head1 KEEPING YOUR WORKING TREE TIDY
92 Don't forget to C<git add> any new files you create.
94 (which is requested with the C<-wgf> option in the recipe above)
97 Many package builds leave dirty git trees.
98 So, commit before building.
99 That way you can use C<git reset --hard>.
101 If you follow this approach
102 you don't need to care about the build dirtying the
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.
107 =head1 OTHER GIT BRANCHES
110 (visible in gitk and git log)
111 is not necessarily related to the maintainer's
112 or upstream's git history (if any).
114 If the maintainer has advertised a git repo with
116 dgit will set up a remote for it,
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.
131 =head1 UPLOADING TO DELAYED
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).
139 dgit(1), dgit(7), dgit-maint-*(7)