chiark / gitweb /
dgit.git
6 years agodgit: When source discrepancy involves mode changes, report them specially.
Ian Jackson [Sat, 6 Jan 2018 02:22:05 +0000 (02:22 +0000)]
dgit: When source discrepancy involves mode changes, report them specially.

Closes:#886442.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Fix suggested diff rune in split brain mode
Ian Jackson [Sat, 6 Jan 2018 01:50:00 +0000 (01:50 +0000)]
dgit: Fix suggested diff rune in split brain mode

In split brain mode, with unexpected diffs, print dgit view commitid
in suggested diff rune.

HEAD is wrong in this case.

Closes:#886443.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Fix message about missing quilt cache entry
Ian Jackson [Sat, 6 Jan 2018 01:42:36 +0000 (01:42 +0000)]
dgit: Fix message about missing quilt cache entry

Should refer to HEAD rather than tree, since dgit needs a commit.

Closes:#884646.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodebian/control: Remove dependency alternative on realpath
Ian Jackson [Sat, 6 Jan 2018 01:38:57 +0000 (01:38 +0000)]
debian/control: Remove dependency alternative on realpath

That package last existed in Debian wheezy.  Closes:#877552.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit(1): Add a bit more rationale (polemic, even). Closes:#874221.
Ian Jackson [Sat, 6 Jan 2018 01:37:07 +0000 (01:37 +0000)]
dgit(1): Add a bit more rationale (polemic, even).  Closes:#874221.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-user(7): Recommend mk-build-deps rather than apt-get build-dep.
Ian Jackson [Sat, 6 Jan 2018 01:33:00 +0000 (01:33 +0000)]
dgit-user(7): Recommend mk-build-deps rather than apt-get build-dep.

Closes:#863361.

Suggested-by: Nikolaus Rath <Nikolaus@rath.org>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: mention dgit-*(7) change
Ian Jackson [Sat, 6 Jan 2018 01:29:18 +0000 (01:29 +0000)]
changelog: mention dgit-*(7) change

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-*(7): --deliberately-not-fast-forward for first dgit push
Sean Whitton [Tue, 28 Feb 2017 16:45:02 +0000 (09:45 -0700)]
dgit-*(7): --deliberately-not-fast-forward for first dgit push

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agochangelog: mention dgit-maint-merge changes (more)
Ian Jackson [Sat, 6 Jan 2018 01:27:22 +0000 (01:27 +0000)]
changelog: mention dgit-maint-merge changes (more)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-maint-merge(7): Include instructions to clone existing repo
Sean Whitton [Fri, 13 Oct 2017 21:08:51 +0000 (14:08 -0700)]
dgit-maint-merge(7): Include instructions to clone existing repo

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agochangelog: mention dgit-maint-merge changes
Ian Jackson [Sat, 6 Jan 2018 01:25:59 +0000 (01:25 +0000)]
changelog: mention dgit-maint-merge changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-maint-merge(7): Mandate pushing upstream branch to alioth
Sean Whitton [Sun, 26 Nov 2017 00:23:07 +0000 (17:23 -0700)]
dgit-maint-merge(7): Mandate pushing upstream branch to alioth

In the case where we are using gbp-import-orig(1) to maintain a
virtual upstream branch, we must push that branch somewhere.  It is
needed whenever we import a new upstream release.

Thanks to Johannes Schauer for pointing out that the manpage
previously said that pushing to alioth is always optional.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agodgit-maint-merge(7): Restructure "NEW UPSTREAM RELEASES"
Sean Whitton [Sun, 26 Nov 2017 00:13:32 +0000 (17:13 -0700)]
dgit-maint-merge(7): Restructure "NEW UPSTREAM RELEASES"

Previously, some instructions applicable and needed whether or not
upstream tags releases in git were given only for the case where
upstream tags releases in git.

Thanks Johannes Schauer for noticing this problem.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agodgit-maint-merge(7): Configure --merge-mode for gbp-import-orig(1)
Sean Whitton [Sat, 25 Nov 2017 23:56:14 +0000 (16:56 -0700)]
dgit-maint-merge(7): Configure --merge-mode for gbp-import-orig(1)

For 3.0 (quilt) source packages, gbp-import-orig(1) defaults to
--merge-mode=replace, which does the wrong thing for patches-applied
repositories (see gbp-import-orig(1)).

Note that we do override this when importing the first upstream
version.  This is needed because git-merge(1) will refuse to merge
unrelated histories.

Thanks to Johannes Schauer for reporting the problem.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agodgit-maint-merge(7): Create an empty branch for upstream source
Sean Whitton [Fri, 16 Jun 2017 12:04:58 +0000 (13:04 +0100)]
dgit-maint-merge(7): Create an empty branch for upstream source

Thanks to Johannes Schauer for finding the problem.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agotest suite: dpkgsourceignores-docs: Correct restriction
Ian Jackson [Sat, 6 Jan 2018 00:41:45 +0000 (00:41 +0000)]
test suite: dpkgsourceignores-docs: Correct restriction

Restrictions need to be invoked in test suites with
  t-restrict NAME-OF-RESTRICTION
not by calling t-restrction-something.  Only the former gets
translated to the format used in debian/tests/control.

Reported-by: Sean Whitton <spwhitton@spwhitton.name>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: document Sean's changes
Ian Jackson [Tue, 15 Aug 2017 16:00:25 +0000 (17:00 +0100)]
changelog: document Sean's changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Fix trailing whitespace
Sean Whitton [Sun, 13 Aug 2017 14:01:10 +0000 (07:01 -0700)]
dgit: Fix trailing whitespace

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agochangelog: Fix typo
Sean Whitton [Sun, 13 Aug 2017 13:56:26 +0000 (06:56 -0700)]
changelog: Fix typo

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
6 years agochangelog: start 4.2
Ian Jackson [Tue, 15 Aug 2017 15:58:29 +0000 (16:58 +0100)]
changelog: start 4.2

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: finalise 4.1 archive/debian/4.1 debian/4.1
Ian Jackson [Mon, 14 Aug 2017 08:31:25 +0000 (09:31 +0100)]
changelog: finalise 4.1

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: Document test suite changes
Ian Jackson [Thu, 3 Aug 2017 11:27:42 +0000 (12:27 +0100)]
changelog: Document test suite changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: gitworktree: Test quiltification
Ian Jackson [Thu, 3 Aug 2017 11:25:48 +0000 (12:25 +0100)]
test suite: gitworktree: Test quiltification

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: gitworktree: Add some more operations
Ian Jackson [Thu, 3 Aug 2017 11:23:42 +0000 (12:23 +0100)]
test suite: gitworktree: Add some more operations

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: dpkgsourceignores-correct: Test that the rune DTRT
Ian Jackson [Thu, 3 Aug 2017 11:22:33 +0000 (12:22 +0100)]
test suite: dpkgsourceignores-correct: Test that the rune DTRT

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: dpkg_source_ignores: Exclude the right set of things
Ian Jackson [Thu, 3 Aug 2017 11:20:36 +0000 (12:20 +0100)]
dgit: dpkg_source_ignores: Exclude the right set of things

Change the dpkg-source -i argument to exclude exactly the right set of
things.  (Sadly this is not a simple rune.)

Previously we might exclude `foo.git', for example !

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Properly shellquote --git-builder argument to gbp
Ian Jackson [Thu, 3 Aug 2017 11:48:05 +0000 (12:48 +0100)]
dgit: Properly shellquote --git-builder argument to gbp

This is about to contain more exciting shell metacharacters.
(Even now, it is wrong without quoting as we end up telling gbp to
pass -i.git/ rather than -i\.git/ to dpkg-source.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: dpkgsourceignores-docs: Use print-dpkg-source-ignores
Ian Jackson [Thu, 3 Aug 2017 11:09:11 +0000 (12:09 +0100)]
test suite: dpkgsourceignores-docs: Use print-dpkg-source-ignores

Rather than fishing the value out of the in-tree dgit source code.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: print-dpkg-source-ignores action
Ian Jackson [Thu, 3 Aug 2017 11:08:31 +0000 (12:08 +0100)]
dgit: print-dpkg-source-ignores action

New print-dpkg-source-ignores option to print the big rune you need to
pass to dpkg-source to make it work exactly the right.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: dpkgsourceignores-docs: Check dgit-maint-merge(7) -i -I rune
Ian Jackson [Thu, 3 Aug 2017 08:53:58 +0000 (09:53 +0100)]
test suite: dpkgsourceignores-docs: Check dgit-maint-merge(7) -i -I rune

Check that the rune we document is the same as dgit actually uses.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-maint-merge(7): Add ' ' around -i\.git/
Ian Jackson [Thu, 3 Aug 2017 08:52:05 +0000 (09:52 +0100)]
dgit-maint-merge(7): Add ' ' around -i\.git/

This manpage should present a shell rune, not a half-quoted thing
whose interpretation is left as a tricky exercise to othe reader.

The ' ' protect the \ so that it would actually get passed to
dpkg-buildpackage.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-maint-merge(7): Reformat slightly
Ian Jackson [Thu, 3 Aug 2017 08:24:27 +0000 (09:24 +0100)]
dgit-maint-merge(7): Reformat slightly

Introduce semantic newlines around the dpg-buildpackage -i -I
rune.  This will make it easier to test.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Break out -i -I rune into a variable
Ian Jackson [Thu, 3 Aug 2017 08:07:44 +0000 (09:07 +0100)]
dgit: Break out -i -I rune into a variable

There is also an instance in dgit-maint-merge.7.pod but that's
trickier to unify.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: Break out t-dgit-manpage
Ian Jackson [Thu, 3 Aug 2017 11:14:41 +0000 (12:14 +0100)]
test suite: Break out t-dgit-manpage

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: stunt gnupg: Much better logging of race errors
Ian Jackson [Fri, 4 Aug 2017 21:27:54 +0000 (22:27 +0100)]
test suite: stunt gnupg: Much better logging of race errors

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: stunt gnupg runs gpg again if it exits status 2
Ian Jackson [Thu, 3 Aug 2017 21:27:28 +0000 (22:27 +0100)]
test suite: stunt gnupg runs gpg again if it exits status 2

Work around gnupg agent connection races by having our stunt gpg
wrapper simply try running gpg again, once, if it exits 2.
This does not fully suppress the bug but it does significantly reduce
the probability.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: Make t-dgit print pwd to stderr, not stdout
Ian Jackson [Thu, 3 Aug 2017 11:13:58 +0000 (12:13 +0100)]
test suite: Make t-dgit print pwd to stderr, not stdout

This means that tests can capture the output from t-dgit without going
wrong.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: Document worktree support
Ian Jackson [Wed, 2 Aug 2017 18:37:00 +0000 (19:37 +0100)]
changelog: Document worktree support

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Make commit_getclogp not leave a lot of detritus in .git/dgit
Ian Jackson [Thu, 3 Aug 2017 17:09:24 +0000 (18:09 +0100)]
dgit: Make commit_getclogp not leave a lot of detritus in .git/dgit

Have it use a fixed filename instead.  It's only needed right away so
that's fine.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactor: Dgit.pm: fresh_playground: Improve error message
Ian Jackson [Thu, 3 Aug 2017 07:30:09 +0000 (08:30 +0100)]
playground refactor: Dgit.pm: fresh_playground: Improve error message

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: gitworktree: New test
Ian Jackson [Wed, 2 Aug 2017 18:35:28 +0000 (19:35 +0100)]
test suite: gitworktree: New test

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: Tolerate worktrees when trying to git-fsck
Ian Jackson [Wed, 2 Aug 2017 18:32:51 +0000 (19:32 +0100)]
test suite: Tolerate worktrees when trying to git-fsck

A `git worktree' has a file for .git.  We still want to fsck them.  We
can simply run the fsck in the directory containing .git, instead.
That works for ordinary trees with a .git directory, and for
worktrees.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory refactor: open_main_gitattrs confesses if $maindir not set
Ian Jackson [Thu, 3 Aug 2017 07:31:12 +0000 (08:31 +0100)]
directory refactor: open_main_gitattrs confesses if $maindir not set

This improves the error message considerably for "didn't call
record_maindir" bugs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoworktree support: dgit: Fix for .git/logs/refs/
Ian Jackson [Wed, 2 Aug 2017 18:29:53 +0000 (19:29 +0100)]
worktree support: dgit: Fix for .git/logs/refs/

Experimentally, both the common dir and the worktree's git dir have a
.git/logs.  But, as might be expected, the worktree's one has the
reflog for its HEAD and not any of the refs/ reflogs.

Implicitly, we are deciding here that the dgit quilt cache is shared
between all worktrees.  That seems fine.  I think we don't ever rely
on its actual current value, so even concurrent dgit runs ought to be
fine.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoworktree support: dgit: Fix for .git/info/attributes
Ian Jackson [Wed, 2 Aug 2017 18:22:28 +0000 (19:22 +0100)]
worktree support: dgit: Fix for .git/info/attributes

Experimentally, this file is in the common dir, not the per-worktree
dir.  Honour $maindir_gitcommon everywhere.

Rename `open_main_gitattrs'.  Previously it could in theory be used in
the playtree (but, it isn't).  Now it always operates on the main
tree.

Indeed, as we require, the `setup' stuff is only done in the main
tree.  The gitattributes fixes for playtrees are done,
unconditionally, with the much simpler hammer in playtree_setup.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoworktree support: Fix playtree_setup
Ian Jackson [Wed, 2 Aug 2017 18:19:38 +0000 (19:19 +0100)]
worktree support: Fix playtree_setup

In a worktree, .git is not a directory.  We need to use
$maindir_common.  Add a comment, too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory handling: dgit: Introduce dgit_privdir and use it
Ian Jackson [Wed, 2 Aug 2017 17:38:32 +0000 (18:38 +0100)]
directory handling: dgit: Introduce dgit_privdir and use it

This removes another pile of open-coded references to .git/

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: sbuild-gitish: Insist on using "build" chroot
Ian Jackson [Thu, 3 Aug 2017 19:34:11 +0000 (20:34 +0100)]
test suite: sbuild-gitish: Insist on using "build" chroot

In "test suite: sbuild-gitish: Find sbuild rune in the manpage" aka
f5c0d33ede8a we accidentally switched from "build" to "jessie".
Randomly messing about with the user's "jessie" chroot is not very
nice.  (And it would break in a hypothetical formal test providing the
x-dgit-schroot-build capability.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoworktree support: Fix ensure_a_playground (gives absolute path now)
Ian Jackson [Wed, 2 Aug 2017 18:17:14 +0000 (19:17 +0100)]
worktree support: Fix ensure_a_playground (gives absolute path now)

Make it honour $maindir_gitdir so it will DTRT in a `git worktree'.
The .git/dgit play area ends up in the .git/worktrees/<worktreename>
for this worktree.

It now returns an absolute path.  The only call site that needs
adjusting is the one in fresh_playground.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory handling: dgit: Use $maindir rather than ../../..
Ian Jackson [Wed, 2 Aug 2017 15:46:37 +0000 (16:46 +0100)]
directory handling: dgit: Use $maindir rather than ../../..

Replace all the open-coded ../.. constructs with references to
$maindir.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory refactoring: dgit clone: call record_maintree in multisuite too
Ian Jackson [Thu, 3 Aug 2017 07:31:57 +0000 (08:31 +0100)]
directory refactoring: dgit clone: call record_maintree in multisuite too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory refactoring: dgit clone: call record_maintree
Ian Jackson [Wed, 2 Aug 2017 18:25:34 +0000 (19:25 +0100)]
directory refactoring: dgit clone: call record_maintree

We are making up our own tree, here.  We will need to call
record_maintree in case we need to use information which it obtains.
Currently, we don't.

But git worktrees are complicated: we are going to have to depend on
the new $maindir_git* variables, in setup_new_tree.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory refactoring: most invocations: call record_maintree
Ian Jackson [Wed, 2 Aug 2017 18:59:53 +0000 (19:59 +0100)]
directory refactoring: most invocations: call record_maintree

We need to call record_maintree so that $maindir and its friends are
set, since we're going to rely on them heavily.  Most operations will
need them.

Any operation that is invoked in a git tree should definitely have
this called.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodirectory refactoring: Rename no_local_git_cfg
Ian Jackson [Wed, 2 Aug 2017 18:56:40 +0000 (19:56 +0100)]
directory refactoring: Rename no_local_git_cfg

This is actually called when we don't know that we are starting in a
git tree.  We want to use this knowledge to control an automatic call
to record_maindir, too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoworktree support: Dgit.pm: Introduce $maindir_gitdir and _commondir
Ian Jackson [Wed, 2 Aug 2017 18:14:40 +0000 (19:14 +0100)]
worktree support: Dgit.pm: Introduce $maindir_gitdir and _commondir

A "git worktree" separates out some of the things which used to be
found in .git, into "common" things and "gitdir" things.

In this patch we simply collect the relevant informaation.  No-one
uses it yet so there is no significant functional change.

However, while we are here, we do improve an error message slightly.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactoring: Dgit.pm: Provide ensure_a_playground
Ian Jackson [Wed, 2 Aug 2017 17:34:02 +0000 (18:34 +0100)]
playground refactoring: Dgit.pm: Provide ensure_a_playground

dgit wants to make a lot of temporary things in .git/dgit.
That's like a playground, but dgit doesn't want it wiped.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactoring: Dgit.pm: Honour $maindir in fresh_playground
Ian Jackson [Wed, 2 Aug 2017 14:52:41 +0000 (15:52 +0100)]
playground refactoring: Dgit.pm: Honour $maindir in fresh_playground

Previously, fresh_playground expected that the playground argument has
exactly the depth .git/FOO/BAR.

Now, it expects that $maindir is set.  In dgit (the only caller right
now) this is always true because dgit now uses fresh_playground.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactoring: dgit: Use playground facilities
Ian Jackson [Wed, 2 Aug 2017 11:28:09 +0000 (12:28 +0100)]
playground refactoring: dgit: Use playground facilities

* Replace implementation of prep_ud with a call to fresh_playground
* Replace references to $ud with $playground
* Replace hardcoded changedir ../../.. etc. with $maindir

The overall functional change is fairly minimal.  We now call getcwd
more often, and when we want to return to the maindir we changedir to
an absolute path instead of a relative one.

Later, we may rename prep_ud, mktree_in_ud_here, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactoring: Dgit.pm: Provide fresh_playground etc.
Ian Jackson [Wed, 2 Aug 2017 14:50:03 +0000 (15:50 +0100)]
playground refactoring: Dgit.pm: Provide fresh_playground etc.

These functions will shortly replace the similar, but less-flexible,
ad-hoc functions in dgit proper.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactoring: Dgit.pm: Expose $local_git_cfg
Ian Jackson [Wed, 2 Aug 2017 14:09:12 +0000 (15:09 +0100)]
playground refactoring: Dgit.pm: Expose $local_git_cfg

This is now the default for playtree_setup.  The caller can simply set
it explicitly.

We make this part of a new :playground export tag for Dgit.pm,
which is going to gain other bits shortly.

And, we add some comments, and move the global; more code and
commentary will appear around this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground refactoring: dgit: Make prep_ud no longer take a directory
Ian Jackson [Wed, 2 Aug 2017 11:17:32 +0000 (12:17 +0100)]
playground refactoring: dgit: Make prep_ud no longer take a directory

Nothing passes this argument, so no functional change.
This will make forthcoming changes more obviously correct.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoRevert "Dgit: Introduce in_workarea and fresh_workarea"
Ian Jackson [Wed, 2 Aug 2017 13:20:32 +0000 (14:20 +0100)]
Revert "Dgit: Introduce in_workarea and fresh_workarea"

This reverts commit aa073c5bdde68a1ab5026ba4daaf29c8bf361532.

These functions are not used on this branch.  I originally put them
here because I thought dgit would want to use them, but actually it
doesn't really.

There are no tests for them here and we are about to engage in
refactoring which will probably accidentally break them.  Instead,
delete them.

This revert should itself be re-reverted when these functionsn are
going to be used.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoplayground: playtree: rename from workarea
Ian Jackson [Fri, 28 Jul 2017 17:27:36 +0000 (18:27 +0100)]
playground: playtree: rename from workarea

We are going to use "playground" for containing temporary directory,
and playtree for git trees within it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit: break must_getcwd out into Dgit.pm
Ian Jackson [Fri, 28 Jul 2017 17:33:52 +0000 (18:33 +0100)]
Dgit: break must_getcwd out into Dgit.pm

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: document refactoring
Ian Jackson [Wed, 26 Jul 2017 22:30:44 +0000 (23:30 +0100)]
changelog: document refactoring

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: factor out build_or_push_prep_early sub
Sean Whitton [Sun, 12 Feb 2017 23:14:24 +0000 (16:14 -0700)]
dgit: factor out build_or_push_prep_early sub

This is to permit code deduplication between the commands for pushing
and building.  Both these sets of commands deny usage of -p, and set
$isuite, $package and $version based on the changelog.

In particular, a command that will perform a build /and/ a push can
first perform the check for -p, set $package and then call functions
to do the build.  These latter functions will not complain that
$package is set thanks to the $build_or_push_prep_early_done logic.

No functional change.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agocmd_push: Factor out all prep code
Sean Whitton [Fri, 3 Feb 2017 04:15:15 +0000 (21:15 -0700)]
cmd_push: Factor out all prep code

Will be re-used by cmd_push_source.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: Refactor to create human-readable $subcommand
Sean Whitton [Fri, 3 Feb 2017 04:11:09 +0000 (21:11 -0700)]
dgit: Refactor to create human-readable $subcommand

$cmd,$subcommand now global vars.

No functional change.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit.pm: in_workarea: Use changedir
Ian Jackson [Tue, 18 Jul 2017 20:44:33 +0000 (21:44 +0100)]
Dgit.pm: in_workarea: Use changedir

This produces better debug output.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit.pm: changedir: Break out from dgit
Ian Jackson [Fri, 14 Jul 2017 15:36:22 +0000 (16:36 +0100)]
Dgit.pm: changedir: Break out from dgit

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit: Introduce in_workarea and fresh_workarea
Ian Jackson [Fri, 3 Feb 2017 16:33:57 +0000 (16:33 +0000)]
Dgit: Introduce in_workarea and fresh_workarea

No callers yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit.pm: git_slurp_config_src: Break out from dgit
Ian Jackson [Fri, 14 Jul 2017 09:53:33 +0000 (10:53 +0100)]
Dgit.pm: git_slurp_config_src: Break out from dgit

We are going to want this so we can provide better subtree setup
functions in Dgit.pm, including the config transfer.

No functional change, except that we now run just "git" from the path,
rather than honouring dgit's @git (which is not available in Dgit.pm).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit.pm: workarea_setup: Break out from dgit
Ian Jackson [Mon, 10 Jul 2017 10:30:51 +0000 (11:30 +0100)]
Dgit.pm: workarea_setup: Break out from dgit

This subroutine needs a hash of the main tree's git config, so that
some of the config settings which affect the object store can be
properly honoured.

Purely code motion, except for the changed reference to $gitcfgs.
No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: simplify gitattrs setup in mktree_in_ud_here
Ian Jackson [Mon, 10 Jul 2017 10:19:27 +0000 (11:19 +0100)]
dgit: simplify gitattrs setup in mktree_in_ud_here

We are going to want to break the meat of mktree_in_ud here out into
Dgit.pm.  Dgit.pm doesn't have access_cfg, is_gitattrs_setup, and so
on.

On the other hand, we don't need any of that here: this is a fresh
tree of our own (so there is no existing .git/info/attributes to
combine with our new settings), and we ignore the config already.

So overall, little functional change: the .git/info/attributes in our
private working areas are now slightly simpler: they don't indirect
via git-defuse-attrs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit.pm: $negate_harmful_gitattrs: Break out from dgit
Ian Jackson [Fri, 10 Mar 2017 17:40:35 +0000 (17:40 +0000)]
Dgit.pm: $negate_harmful_gitattrs: Break out from dgit

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoDgit.pm: runcmd: Break out from dgit
Ian Jackson [Fri, 3 Feb 2017 21:54:56 +0000 (21:54 +0000)]
Dgit.pm: runcmd: Break out from dgit

Move runcmd into Dgit.pm.

We need to change dgit-repos-server too, but luckily its definition is
essentially equivalent.

No functional change to dgit.  dgit-repos-server now prints somewhat
better error messages when subprocesses fail.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: sbuild-gitish: Find sbuild rune in the manpage
Ian Jackson [Sun, 16 Jul 2017 18:08:24 +0000 (19:08 +0100)]
test suite: sbuild-gitish: Find sbuild rune in the manpage

This avoids duplicating this rune (so the manpage can't get out of
date).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-user(7): Provide information about how to use sbuild
Ian Jackson [Sun, 16 Jul 2017 17:27:16 +0000 (18:27 +0100)]
dgit-user(7): Provide information about how to use sbuild

Quite ugly due to #868527.  Closes:#868526.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-user(7): Fixed example rune to use curl
Ian Jackson [Sun, 16 Jul 2017 17:26:07 +0000 (18:26 +0100)]
dgit-user(7): Fixed example rune to use curl

curl prints to stdout, as the rune expects.

Reported-by: Simon Tatham
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agosbuild-gitish: New test case to check running sbuild from git
Ian Jackson [Sun, 16 Jul 2017 16:51:15 +0000 (17:51 +0100)]
sbuild-gitish: New test case to check running sbuild from git

This involves creating a new "gitish-only" branch in the example
worktree.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoMerge branch 'stable' into HEAD base.pbuilder-config
Ian Jackson [Sun, 16 Jul 2017 20:40:29 +0000 (21:40 +0100)]
Merge branch 'stable' into HEAD

6 years agochangelog: finalise 3.12 archive/debian/3.12 debian/3.12
Ian Jackson [Sun, 16 Jul 2017 20:37:03 +0000 (21:37 +0100)]
changelog: finalise 3.12

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoquilt fixup: Check that funny changes are represented properly
Ian Jackson [Sun, 16 Jul 2017 11:55:54 +0000 (12:55 +0100)]
quilt fixup: Check that funny changes are represented properly

Specifically, do dgit push --dry-run.  This will check that the source
package and git tree agree - ie, that what we have produced can
round-trip through dpkg-source.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoquilt fixup: Check we can delete files with funny modes
Ian Jackson [Sun, 16 Jul 2017 11:54:11 +0000 (12:54 +0100)]
quilt fixup: Check we can delete files with funny modes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: unrepres. changes: Tolerate creation of symlinks
Ian Jackson [Sun, 16 Jul 2017 10:41:14 +0000 (11:41 +0100)]
dgit: unrepres. changes: Tolerate creation of symlinks

Experimentally, dpkg-source on stretch will create patches to create
new symlinks.  (It will fail on attempts to modify existing symlinks
and it ignores attempts to change plain file executability.)

Implementation: add an alternative which tolerates the git symlink
mode.  This replaces the check on $oldmode, which in this context we
know is all 0s and can therefore never match.

While we're here, change the error message.

Closes:#857382.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: unrepres. changes: Tolerate deletion of executable files
Ian Jackson [Sun, 16 Jul 2017 10:28:50 +0000 (11:28 +0100)]
dgit: unrepres. changes: Tolerate deletion of executable files

We don't care what the old mode was; if we tell dpkg-source to record
the deletion it can do so.

But we do care that it was a file.  Experimentally, dpkg-source on
stretch ignores attempts to delete symlinks.

The removal of the check for $newmode has no functional change,
because in this context we know that $newmode is all 0s.  If it
wasn't, we would have been in "both old and new files exist", above.
So that limb of the test will never match and should be removed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: unrepres. changes: Separate out creation and deletion
Ian Jackson [Sun, 16 Jul 2017 10:26:32 +0000 (11:26 +0100)]
dgit: unrepres. changes: Separate out creation and deletion

We are going to want to handle these cases separately because the
behaviour of dpkg-source is different.

In this commit, simply clone the existing code (and add a few
comments), so no functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit: unrepres. changes: Prepare to tolerate symlinks
Ian Jackson [Sun, 16 Jul 2017 10:19:29 +0000 (11:19 +0100)]
dgit: unrepres. changes: Prepare to tolerate symlinks

Permit symlinks (which have mode 120000 in git) to make their way
through for more detailed checks.

No functional change except to error messages, because:

 * If neither thing was a symlink, then the existing regexps
   still match and the new "modified symlink" clause will not,
   so the flow is unchanged.

 * Otherwise, if both $oldmode and $newmode match [^0], ie,
   this is a modification rather than deletion or removal,
   we insist that $oldmode=$newmode, and then, fail the
   new "modified symlink" check.

 * Otherwise, we fail the check for default mode.

So in the case we are allowing to proceed further, we fail as before.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: Test symlink modification and deletion, not creation
Ian Jackson [Sun, 16 Jul 2017 10:50:40 +0000 (11:50 +0100)]
test suite: Test symlink modification and deletion, not creation

We are going to tolerate symlink creation, because dpkg-source can
consume patches to create symlinks (even though it cannot create
them).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: run git gc on tests/worktrees/example_1.0.tar
Ian Jackson [Sun, 16 Jul 2017 11:35:10 +0000 (12:35 +0100)]
test suite: run git gc on tests/worktrees/example_1.0.tar

Specifically,
  git-gc --aggressive --prune=all
This shrinks it quite a lot.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: Introduce example 1.1 orig containg some interesting objects
Ian Jackson [Sun, 16 Jul 2017 11:31:49 +0000 (12:31 +0100)]
test suite: Introduce example 1.1 orig containg some interesting objects

We are going to want to test alternation/deletion of symlinks and
non-644 files.

To test this we need to switch to using example_1.1.orig.tar.gz (and
the corresponding git branch in the worktree), so that we have
such existing objects.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit-repos-server: Do not reject commits with no author/committer email
Ian Jackson [Sun, 16 Jul 2017 01:23:26 +0000 (02:23 +0100)]
dgit-repos-server: Do not reject commits with no author/committer email

But still insist on date, and hence on the actual committer and author
commit header fields.  Peter Green reports that eg 66c65d90db100435 in
upstream linux.git is such a commit (and is accepted by github).
Closes:#863353.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: import-dsc: Test missing files, particularly in ..
Ian Jackson [Sat, 15 Jul 2017 23:47:01 +0000 (00:47 +0100)]
test suite: import-dsc: Test missing files, particularly in ..

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agotest suite: t-report-fail: print $PWD as part of failure message
Ian Jackson [Sat, 15 Jul 2017 23:46:16 +0000 (00:46 +0100)]
test suite: t-report-fail: print $PWD as part of failure message

This is really helpful when debugging.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit import: Avoid making broken symlinks in ..
Ian Jackson [Sat, 15 Jul 2017 22:27:29 +0000 (23:27 +0100)]
dgit import: Avoid making broken symlinks in ..

In most cases we could carry on and fail later.  But creating a broken
symlink is undesirable, particularly because it might prevent dgit
from trying to make a non-broken symlink pointing elsewhere in future
(or prevent dget from downloading the file).

Even worse, if the dsc is in .. but an absolute path was provided, we
would make a circular symlink!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit import: Right error message for missing files in ..
Ian Jackson [Sat, 15 Jul 2017 22:21:13 +0000 (23:21 +0100)]
dgit import: Right error message for missing files in ..

Close examination of this code path reveals that:
 * The error is generated only if $there contains no slash.
 * This can only occur if $dscfn matches the first regexp,
   ie $dscfn is [./]../X in which case $there becomes X
 * So in this situation, $there is simply the dsc filename
   which is supposed to be in ..
 * What we should be testing is ../$f but that is $here
   which is what are trying to create and which we statted
   earlier and got ENOENT for.

So this occurs when the dsc is in .. and a file it refers to is
missing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agodgit import: Defend against broken symlinks in ..
Ian Jackson [Sat, 15 Jul 2017 22:15:54 +0000 (23:15 +0100)]
dgit import: Defend against broken symlinks in ..

Provide a special error message if lstat succeeds but lstat fails.

This is not hypothetical - currently even dgit import ../blah.dsc can
generate this situation !

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoMerge tag 'archive/debian/3.11_deb9u1' into stable
Ian Jackson [Sat, 15 Jul 2017 21:58:53 +0000 (22:58 +0100)]
Merge tag 'archive/debian/3.11_deb9u1' into stable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agochangelog: finalise stable update archive/debian/3.11_deb9u1 debian/3.11_deb9u1
Ian Jackson [Tue, 11 Jul 2017 16:12:08 +0000 (17:12 +0100)]
changelog: finalise stable update

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 years agoMerge branch 'stable'
Ian Jackson [Sun, 9 Jul 2017 15:29:38 +0000 (16:29 +0100)]
Merge branch 'stable'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>