This file is indexed.

/usr/share/doc/xorg/reference/git-usage.html is in xserver-xorg 1:7.6+12ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.6" />
<title>Git usage</title>
<link rel="stylesheet" href="../xsf.css" type="text/css" />
<script type="text/javascript" src="../asciidoc-xhtml11.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install(2);
/*]]>*/
</script>
</head>
<body class="article">
<div id="header">
<h1><a href="../index.html">XSF</a> / Git usage</h1>
<span id="author">Cyril Brulebois</span><br />
<span id="email"><tt>&lt;<a href="mailto:kibi@debian.org">kibi@debian.org</a>&gt;</tt></span><br />
<div id="toc">
  <div id="toctitle">Table of Contents</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">The old documentation is still available on the wiki:
<a href="http://wiki.debian.org/XStrikeForce/git-usage">wiki.debian.org/XSF/git-usage</a>;
this documentation is just a draft for now.</td>
</tr></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_getting_started">Getting started</h2>
<div class="sectionbody">
<div class="paragraph"><p>Upstream repositories are hosted on
<a href="http://cgit.freedesktop.org/">git.freedesktop.org</a></p></div>
<div class="paragraph"><p>Debian repositories are hosted on
<a href="http://git.debian.org/">git.debian.org</a> under the <tt>pkg-xorg/*</tt>
namespace. Each repository is about a single Debian source package.</p></div>
<div class="paragraph"><p>We have two types of repositories:</p></div>
<div class="ulist"><ul>
<li>
<p>
<strong>regular</strong> packages: 1 upstream repository → 1 Debian repository → 1
   Debian source package (non-native).
</p>
</li>
<li>
<p>
<strong>bundle</strong> packages: multiple upstream repositories → 1 Debian
   repository → 1 Debian source package (native).
</p>
</li>
</ul></div>
<div class="paragraph"><p>A local git repository can have several remotes. In the context of
Debian packaging, one usually starts by cloning the Debian repository,
so <tt>origin</tt> will likely point to <tt>git.debian.org</tt>. One can use
<tt>upstream</tt> to point to <tt>anongit.freedesktop.org</tt>. The following
documentation assumes this convention.</p></div>
<div class="paragraph"><p>The following bits in <tt>~/.gitconfig</tt> will make it possible to fetch
updates using the <tt>git</tt> protocol (anonymously), and to push updates
through <tt>ssh</tt> without having to fiddle with the remote’s URL (in other
words: using <tt>git://git.debian.org</tt> everywhere):</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>[url "ssh://git.debian.org"]
    pushInsteadOf = "git://git.debian.org"</tt></pre>
</div></div>
<div class="paragraph"><p>To get the repository from <tt>git.debian.org</tt> one can run <tt>debcheckout
$package</tt> (or <tt>debcheckout $package $package.git</tt>), which will use the
<tt>Vcs-Git</tt> fields in the APT cache to pick the appropriate git
location. To add the <tt>upstream</tt> remote (using the info stored in
<tt>debian/watch</tt>), one can use <tt>xsf-remote-add-upstream</tt> script from the
<a href="http://git.debian.org/?p=pkg-xorg/debian/xsf-tools.git">pkg-xorg/debian/xsf-tools.git</a>
repository.</p></div>
<div class="paragraph"><p><strong>TODO:</strong> There will be more information about how to deal with the
many repositories maintained by the X Strike Force in a later chapter.</p></div>
<div class="paragraph"><p>The usual workflow is to keep the target suite in <tt>debian/changelog</tt>
to <tt>UNRELEASED</tt> until the upload happens, the last commit before a
commit being only <tt>dch -r</tt>. To achieve that, and to avoid noise since
those packages are comaintained, it’s advised to set the following
variable in <tt>~/.devscripts</tt>:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>DEBCHANGE_RELEASE_HEURISTIC=changelog</tt></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_regular_packages">Regular packages</h2>
<div class="sectionbody">
<div class="paragraph"><p>For most packages (exceptions include <tt>xorg-server</tt>), development is
linear, and happens in a <tt>master</tt> branch. That <tt>master</tt> branch is
pushed in the Debian repository as <tt>upstream-$suite</tt>
(e.g. <tt>upstream-unstable</tt>), depending on the target suite. Usually,
<tt>upstream-unstable</tt> tracks <tt>upstream/master</tt>.</p></div>
<div class="paragraph"><p>The packaging is kept in <tt>debian-$suite</tt> branches, branched from
<tt>upstream-$suite</tt>. When cloning a Debian repository, the default
branch is <tt>debian-unstable</tt>.</p></div>
<div class="paragraph"><p>To create the initial packaging from the <tt>upstream-unstable</tt> branch,
just run <tt>git checkout -b debian-unstable</tt>, add packaging files
(<tt>changelog</tt>, <tt>control</tt>, <tt>copyright</tt>, <tt>rules</tt> etc. under <tt>debian/</tt>),
and that’s it.</p></div>
<div class="paragraph"><p>Here’s how to merge from upstream (<tt>$foo</tt> being a tag or
<tt>upstream/master</tt>):</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>    git checkout upstream-unstable
    git merge $foo
    git log $foo &gt; ChangeLog
    dch -v $debianrevision
    git commit -am 'Bump changelogs.'</tt></pre>
</div></div>
<div class="paragraph"><p><tt>$debianrevision</tt> is usually <tt>$foo</tt> with <tt>-1</tt> appended (first upload),
and sometimes prepended with a epoch (for example <tt>2:</tt>). Passing
<tt>$foo-1</tt> is usually a good rule of thumb, since <tt>dch</tt> will complain if
the epoch is missing (given the specified version string wouldn’t be
newer than the current one).</p></div>
<div class="sect2">
<h3 id="_when_development_isn_t_linear">When development isn’t linear</h3>
<div class="paragraph"><p>For packages like <tt>xorg-server</tt> and <tt>libx11</tt>, there are stable
branches which receive updates for a while. Trying to switch from
<tt>1.10.2</tt> to <tt>1.11.0</tt> might trigger a lot of conflicts. But in the end
what matters is the changes between <tt>upstream-$suite</tt> and
<tt>debian-$suite</tt>. Here’s an example, supposing <tt>upstream-unstable</tt> and
<tt>debian-unstable</tt> are pointing to the “old” branches, and supposing
the new branch is <tt>upstream/master</tt>:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git checkout -b debian-unstable-new upstream/master
git merge -s ours upstream-unstable
git merge debian-unstable
git branch -d debian-unstable
git branch -m debian-unstable</tt></pre>
</div></div>
<div class="paragraph"><p>Subtitles:</p></div>
<div class="ulist"><ul>
<li>
<p>
Create a <tt>debian-unstable-new</tt> branch starting with the upstream
  <tt>master</tt> branch, and switch to it.
</p>
</li>
<li>
<p>
“Merge” the old <tt>upstream-unstable</tt> branch, actually keeping only
  the new upstream branch.
</p>
</li>
<li>
<p>
Merge the old packaging on top of it.
</p>
</li>
<li>
<p>
Remove the old branch (so that the name can be reused).
</p>
</li>
<li>
<p>
Rename the current <tt>debian-unstable-new</tt> branch into
  <tt>debian-unstable</tt>.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Since the tip of the new <tt>debian-unstable</tt> branch is a descendant of
the tip of the old <tt>debian-unstable</tt> one, it can be pushed normally.</p></div>
<div class="paragraph"><p>Since old <tt>upstream-unstable</tt> and new <tt>upstream-unstable</tt> diverged,
this branch has to be pushed with a <tt>-f</tt> to force the update (it’s not
a fast-forward).</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_bundle_packages">Bundle packages</h2>
<div class="sectionbody">
<div class="paragraph"><p>One bundle package is a Debian native package, with just a (Debian)
tarball, instead of an upstream tarball plus a Debian diff.</p></div>
<div class="paragraph"><p>There is no upstream branches here, only <tt>debian-$suite</tt>.</p></div>
<div class="paragraph"><p>The repository contains a <tt>debian/</tt> directory for the packaging, and
one directory per upstream source. Merging a new upstream release
means updating the contents of the relevant directory with the
contents of the new upstream tarball. Fetching new tarballs is
automated through a specific target: <tt>make -f debian/rules
get-tarballs</tt></p></div>
<div class="paragraph"><p>To perform an update, first run <tt>dch -i</tt> to create a new changelog
entry if the previous commit was an upload (the new entry targets the
<tt>UNRELEASED</tt> suite, see “Foreword”).</p></div>
<div class="paragraph"><p>Assuming <tt>get-tarballs</tt> made <tt>foo-bar.tar.gz</tt> appear in the top-level
directory, here’s how to update (trailing slashes are not needed, just
there to clarify we’re working on directories):</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git rm -r foo/
tar xf foo-bar.tar.gz
mv foo-bar/ foo/
git add foo/
dch "foo bar"
debcommit -a</tt></pre>
</div></div>
<div class="paragraph"><p>Using the <tt>xsf-remote-add-upstream</tt> script will create several
<tt>upstream-$foo</tt> remotes, using info stored in <tt>debian/watch*</tt>. This
helps browsing the history of a given repository (rather than having
to look at a big fat diff with autogenerated files in the middle).</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_upgrade_checklist">Upgrade checklist</h2>
<div class="sectionbody">
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">Since it’s likely for a reader of this page to be on her way to update
a package, here’s a tiny upgrade checklist.</td>
</tr></table>
</div>
<div class="paragraph"><p>Basic checks include looking into what happened to those files since
the last packaging update:</p></div>
<div class="ulist"><ul>
<li>
<p>
<tt>COPYING</tt>: Update <tt>debian/copyright</tt> accordingly.
</p>
</li>
<li>
<p>
<tt>configure.ac</tt> (or <tt>configure.in</tt>): Update (build-)dependencies
  accordingly.
</p>
</li>
</ul></div>
<div class="paragraph"><p>About xorg macros (they show up very often in the diff), they’re
shipped in the <tt>xutils-dev</tt> package, which contains a file to help map
macro versions and package versions:
<tt>/usr/share/doc/xutils-dev/versions</tt></p></div>
<div class="paragraph"><p>Some packages might have more specific instructions. That’s the case
for at least <tt>xorg-server</tt>. See its <tt>debian/README.source</tt>, below the
generic “how to use quilt” blurb.</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2011-08-08 10:58:19 UTC
</div>
</div>
</body>
</html>