chiark / gitweb /
git-debrebase: merge: Comment about laundry of merge of unstitched
[dgit.git] / dgit.7
diff --git a/dgit.7 b/dgit.7
index f7e50e4b6c45ec05efbd636ba1b6a5fdfc3ba00f..b623d8cf6af252261a1dd16961ff7be9812a0a7c 100644 (file)
--- a/dgit.7
+++ b/dgit.7
@@ -56,8 +56,12 @@ server to authenticate pushes.
 Uploads made by dgit contain an additional field
 .B Dgit
 in the source package .dsc.  (This is added by dgit push.)
-This specifies a commit (an ancestor of the dgit/suite
-branch) whose tree is identical to the unpacked source upload.
+This specifies: a commit (an ancestor of the dgit/suite
+branch) whose tree is identical to the unpacked source upload;
+the distro to which the upload was made;
+a tag name which can be used to fetch the git commits;
+and
+a url to use as a hint for the dgit git server for that distro.
 
 Uploads not made by dgit are represented in git by commits which are
 synthesised by dgit.  The tree of each such commit corresponds to the
@@ -193,15 +197,76 @@ import existing vcs history
 (which might not be faithful to dgit's invariants)
 or previous non-Dgit uploads
 (which would not provide a very rich history).
+
+git represents only file executability.
+git does not represent empty directories,
+or any leaf objects other than plain files and symlinks.
+The behaviour of Debian source package formats
+on objects with unusual permissions is complicated.
+Some pathological Debian source packages will no longer build
+if empty directories are pruned
+(or if other things not reproduced by git are changed).
+Such sources cannot be worked with properly in git,
+and therefore not with dgit either.
 .SH READ-ONLY DISTROS
 Distros which do not maintain a set of dgit history git repositories
 can still be used in a read-only mode with dgit.  Currently Ubuntu
 is configured this way.
+.SH GITATTRIBUTES
+git has features which can automatically transform files
+as they are being copied between the working tree
+and the git history.
+The attributes can be specified in the source tree itself,
+in
+.BR .gitattributes .
+See \fBgitattributes\fP(5).
+
+These transformations are context-sensitive
+and not, in general, reversible,
+so dgit operates on the principle that
+the dgit git history contains the actual contents of the package.
+(When dgit is manipulating a .dsc,
+it does so in a private area,
+where the transforming gitattributes are defused,
+to achieve this.)
+
+If transforming gitattributes are used,
+they can cause trouble,
+because the working tree files can differ from
+the git revision history
+(and therefore from the source packages).
+dgit warns if it finds a .gitattributes file
+(in a package being fetched or imported),
+unless the transforming gitattributes have been defused.
+
+dgit clone
+and dgit setup-new-tree
+disable transforming gitattributes
+by default,
+by creating a suitable .git/info/attributes.
+See
+.B dgit setup-new-tree
+and
+.B dgit setup-gitattributes
+in dgit(1).
 .SH PACKAGE SOURCE FORMATS
 If you are not the maintainer, you do not need to worry about the
 source format of the package.  You can just make changes as you like
 in git.  If the package is a `3.0 (quilt)' package, the patch stack
 will usually not be represented in the git history.
+.SH FILE EXECUTABILITY
+Debian source package formats
+do not always faithfully reproduce
+changes to executability.
+But dgit insists that the result of dgit clone is identical
+(as far as git can represent - see Limitations, above)
+to the result of dpkg-source -x.
+
+So files that are executable in your git tree
+must be executable in the result of dpkg-source -x
+(but often aren't).
+If a package has such troublesome files,
+they have to be non-executable in dgit-compatible git branches.
 .SH FORMAT 3.0 (QUILT)
 For a format `3.0 (quilt)' source package, dgit may have to make a
 commit on your current branch to contain metadata used by quilt and
@@ -219,6 +284,13 @@ pushing.  The only thing you need to know is that dgit build, sbuild,
 etc., may make new commits on your HEAD.  If you're not a quilt user
 this commit won't contain any changes to files you care about.
 
+Simply commiting to source files
+(whether in debian/ or not, but not to patches)
+will result in a branch that dgit quilt-fixup can linearise.
+Other kinds of changes,
+including editing patches or merging,
+cannot be handled this way.
+
 You can explicitly request that dgit do just this fixup, by running
 dgit quilt-fixup.
 
@@ -226,7 +298,85 @@ If you are a quilt user you need to know that dgit's git trees are
 `patches applied packaging branches' and do not contain the .pc
 directory (which is used by quilt to record which patches are
 applied).  If you want to manipulate the patch stack you probably want
-to be looking at tools like git-dpm.
+to be looking at tools like
+git-debrebase, gbp pq, or git-dpm.
+
+.SS quilt fixup error messages
+When dgit's quilt fixup fails, it prints messages like this:
+
+.EX
+dgit: base trees orig=5531f03d8456b702eab6 o+d/p=135338e9cc253cc85f84
+dgit: quilt differences: src:  == orig ##     gitignores:  == orig ##
+dgit: quilt differences:      HEAD ## o+d/p               HEAD ## o+d/p
+starting quiltify (multiple patches, linear mode)
+
+dgit: error: quilt fixup cannot be linear.  Stopped at:
+dgit:  696c9bd5..84ae8f96: changed debian/patches/test-gitignore
+.EE
+
+.TP
+.B orig
+is an import of the .orig tarballs dgit found,
+with the debian/ directory from your HEAD substituted.
+This is a git tree object, not a commit:
+you can pass its hash to git-diff but not git-log.
+
+.TP
+.B o+d/p
+is another tree object,
+which is the same as orig
+but with the patches from debian/patches applied.
+
+.TP
+.B HEAD
+is of course your own git HEAD.
+
+.TP
+.B quilt differences
+shows whether each of the these trees differs from the others
+(i) in upstream files excluding .gitignore files;
+(ii) in upstream .gitignore files.
+.B ==
+indicates equality;
+.B ##
+indicates inequality.
+.LP
+dgit quilt-fixup --quilt=linear walks commits
+backwards from your HEAD
+trying to construct a linear set of additional patches,
+starting at the end.
+It hopes to eventually find an ancestor
+whose tree is identical to o+d/p in all upstream files.
+
+In the error message,
+696c9bd5..84ae8f96
+is the first commit child-parent edge
+which cannot be sensibly be
+either ignored, or turned into a patch in debian/patches.
+In this example, this is because
+it itself changes files in debian/patches,
+indicating that something unusual is going on
+and that continuing is not safe.
+But you might also see other kinds of troublesome commit or edge.
+
+Your appropriate response depends on the cause and the context.
+If you have been freely merging your git branch
+and do not need need a pretty linear patch queue,
+you can use
+.B --quilt=smash
+(or use the
+.B 1.0
+or
+.B single-debian-patch
+source formats; see
+.BR dpkg-source(1) .)
+If you want a pretty linear series,
+and this message is unexpected,
+it can mean that you have unwittingly committed changes
+that are not representable by dpkg-source (such as some mode changes).
+Or maybe you just forgot a necessary
+.B --quilt=
+option.
 .SH SPLIT VIEW QUILT MODE
 When working with git branches intended
 for use with the `3.0 (quilt)' source format
@@ -260,7 +410,7 @@ is a patches-applied or patches-unapplied tree.
 Split view conversions are cached in the ref
 dgit-intern/quilt-cache.
 This should not be manipulated directly.
-.SH FILES IN THE SOURCE PACKAGE BUT NOT IN GIT - AUTOTOOLS ETC.
+.SH FILES IN THE ORIG TARBALL BUT NOT IN GIT - AUTOTOOLS ETC.
 This section is mainly of interest to maintainers who want to use dgit
 with their existing git history for the Debian package.
 
@@ -278,6 +428,17 @@ branches, it will fail.
 As the maintainer you therefore have the following options:
 .TP
 \(bu
+Delete the files from your git branches,
+and your Debian source packages,
+and carry the deletion as a delta from upstream.
+(With `3.0 (quilt)' this means represeting the deletions as patches.
+You may need to pass --include-removal to dpkg-source --commit,
+or pass corresponding options to other tools.)
+This can make the Debian
+source package less useful for people without Debian build
+infrastructure.
+.TP
+\(bu
 Persuade upstream that the source code in their git history and the
 source they ship as tarballs should be identical.  Of course simply
 removing the files from the tarball may make the tarball hard for
@@ -288,18 +449,6 @@ files, perhaps with some simple automation to deal with conflicts and
 spurious changes.  This has the advantage that someone who clones
 the git repository finds the program just as easy to build as someone
 who uses the tarball.
-.TP
-\(bu
-Have separate git branches which do contain the extra files, and after
-regenerating the extra files (whenever you would have to anyway),
-commit the result onto those branches.
-.TP
-\(bu
-Provide source packages which lack the files you don't want
-in git, and arrange for your package build to create them as needed.
-This may mean not using upstream source tarballs and makes the Debian
-source package less useful for people without Debian build
-infrastructure.
 .LP
 Of course it may also be that the differences are due to build system
 bugs, which cause unintended files to end up in the source package.
@@ -323,7 +472,7 @@ to delete these files.
 .LP
 dpkg-source does not
 (with any of the commonly used source formats)
-represent deletion of files (outside debian/) present in upstream.
+represent deletion of binaries (outside debian/) present in upstream.
 Thus deleting such files in a dpkg-source working tree does not
 actually result in them being deleted from the source package.
 Thus