chiark / gitweb /
dgit.git
2 years agoTest suite: debpolicy-quilt-gbp: New test
Ian Jackson [Sun, 18 Sep 2016 23:56:59 +0000 (00:56 +0100)]
Test suite: debpolicy-quilt-gbp: New test

Check that drs and Debian policy permit split brain.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoChangelog handling: Replace a call to parsechangelog with commit_getclogp
Ian Jackson [Sun, 18 Sep 2016 12:26:01 +0000 (13:26 +0100)]
Changelog handling: Replace a call to parsechangelog with commit_getclogp

This is less code, and takes advantage of the memoisation.

No overall functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoChangelog handling: No not check out last push any more during raw import
Ian Jackson [Sun, 18 Sep 2016 12:23:38 +0000 (13:23 +0100)]
Changelog handling: No not check out last push any more during raw import

We now get the changelog with mergeinfo_getclogp (which just fetches
the changelog blob).  This working tree is not used for anything else,
and is deleted at the end of the function.  So there is no need to
switch branches.

There should be no overall behavioural change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoChangelog handling: Use mergeinfo_getclogp during raw import
Ian Jackson [Sun, 18 Sep 2016 12:23:07 +0000 (13:23 +0100)]
Changelog handling: Use mergeinfo_getclogp during raw import

No overall functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoChangelog handling: Provide commit_getclogp (nfc)
Ian Jackson [Sun, 18 Sep 2016 12:14:28 +0000 (13:14 +0100)]
Changelog handling: Provide commit_getclogp (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoPush reorg: Have FF check use dgit view, not HEAD
Ian Jackson [Sun, 18 Sep 2016 11:49:48 +0000 (12:49 +0100)]
Push reorg: Have FF check use dgit view, not HEAD

Quilt fixup may generate a dgit view, which is not HEAD, and it is the
dgit view which will actually be pushed to the archive, so it is that
that should be checked.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodel_lrfetchrefs: Improve debug output a bit
Ian Jackson [Sun, 18 Sep 2016 11:49:39 +0000 (12:49 +0100)]
del_lrfetchrefs: Improve debug output a bit

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoPush reorg: Postpone FF check
Ian Jackson [Sun, 18 Sep 2016 11:46:37 +0000 (12:46 +0100)]
Push reorg: Postpone FF check

We need to do this after the quilt fixup, because we are going to make
quilt fixup perhaps generate a pseudo-merge.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoTest suite: run-all: Ensure tests/tmp/ exists
Ian Jackson [Sun, 25 Sep 2016 19:09:45 +0000 (20:09 +0100)]
Test suite: run-all: Ensure tests/tmp/ exists

ca007b4d "Test suite: run-all: record output" introduced a regression:
if tests/tmp/ does not exist on entry, tests/run-all fails.

So create it first.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoPush reorg: Introduce $archive_hash in dopush (nfc)
Ian Jackson [Sun, 18 Sep 2016 11:45:01 +0000 (12:45 +0100)]
Push reorg: Introduce $archive_hash in dopush (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agofetch_from_archive: Mention that git_fetch_us must be called first
Ian Jackson [Sun, 18 Sep 2016 11:37:49 +0000 (12:37 +0100)]
fetch_from_archive: Mention that git_fetch_us must be called first

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodgit: changedir: use confess, to get a stack trace
Ian Jackson [Sun, 18 Sep 2016 11:34:45 +0000 (12:34 +0100)]
dgit: changedir: use confess, to get a stack trace

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agofetch_from_archive: Return the hash (and update the comment)
Ian Jackson [Sun, 18 Sep 2016 11:32:49 +0000 (12:32 +0100)]
fetch_from_archive: Return the hash (and update the comment)

All the call sites currently treat the return value as a boolean, and
the truthiness and falsishness of return values is unchanged, so there
is no overall functional change.

Also, clarify the head comment somewhat.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agodgit: Add a couple of comments
Ian Jackson [Sun, 18 Sep 2016 11:14:51 +0000 (12:14 +0100)]
dgit: Add a couple of comments

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoPush reorg: Move ff check out of cmd_push into dpush (nfc)
Ian Jackson [Sun, 18 Sep 2016 11:13:52 +0000 (12:13 +0100)]
Push reorg: Move ff check out of cmd_push into dpush (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoTODO.BRANCH: add some desires
Ian Jackson [Thu, 15 Sep 2016 18:40:37 +0000 (19:40 +0100)]
TODO.BRANCH: add some desires

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: quilt-gb-build-modes: Test --clean=dpkg-source too
Ian Jackson [Mon, 5 Sep 2016 21:42:35 +0000 (22:42 +0100)]
Test suite: quilt-gb-build-modes: Test --clean=dpkg-source too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: quilt-gb-build-modes: Fixes, passes now
Ian Jackson [Mon, 5 Sep 2016 21:42:21 +0000 (22:42 +0100)]
Test suite: quilt-gb-build-modes: Fixes, passes now

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: lib-build-modes: Remove a couple of hardcoded versions
Ian Jackson [Mon, 5 Sep 2016 21:41:52 +0000 (22:41 +0100)]
Test suite: lib-build-modes: Remove a couple of hardcoded versions

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: quilt-gbp-build-modes: New test, which does not pass yet
Ian Jackson [Sun, 3 Jul 2016 23:02:33 +0000 (00:02 +0100)]
Test suite: quilt-gbp-build-modes: New test, which does not pass yet

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: With sbuild, unapply patches in right dir
Ian Jackson [Mon, 5 Sep 2016 21:41:16 +0000 (22:41 +0100)]
dgit: With sbuild, unapply patches in right dir

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: With gbp-build, provide gbp with patches-unapplied tree
Ian Jackson [Mon, 5 Sep 2016 21:40:26 +0000 (22:40 +0100)]
dgit: With gbp-build, provide gbp with patches-unapplied tree

We may still need to apply, and then unapply, the patches, so as to
clean the tree.  But gbp itself expects a patches-unapplied tree.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: Make maybe_unapply_patches_again reset $patches_applied_dirtily
Ian Jackson [Mon, 5 Sep 2016 21:39:43 +0000 (22:39 +0100)]
dgit: Make maybe_unapply_patches_again reset $patches_applied_dirtily

That makes it idempotent.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Some more todo items
Ian Jackson [Mon, 5 Sep 2016 21:39:16 +0000 (22:39 +0100)]
TODO.BRANCH: Some more todo items

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: TODO re fetch patterns
Ian Jackson [Sun, 4 Sep 2016 19:58:17 +0000 (20:58 +0100)]
TODO.BRANCH: TODO re fetch patterns

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Add a new desire
Ian Jackson [Sun, 4 Sep 2016 19:50:21 +0000 (20:50 +0100)]
TODO.BRANCH: Add a new desire

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: quilt-gbp: Provide and use t-gbp-pushed-good
Ian Jackson [Sun, 4 Sep 2016 19:47:00 +0000 (20:47 +0100)]
Test suite: quilt-gbp: Provide and use t-gbp-pushed-good

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Break out t-incoming-dsc (nfc)
Ian Jackson [Sun, 4 Sep 2016 19:46:25 +0000 (20:46 +0100)]
Test suite: Break out t-incoming-dsc (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Break out t-pushed-good-core (nfc)
Ian Jackson [Sun, 4 Sep 2016 19:46:03 +0000 (20:46 +0100)]
Test suite: Break out t-pushed-good-core (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: t-output: support expecting empty files
Ian Jackson [Sun, 4 Sep 2016 19:45:27 +0000 (20:45 +0100)]
Test suite: t-output: support expecting empty files

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit brain: Push correct view to dgit repos server
Ian Jackson [Sun, 4 Sep 2016 19:44:57 +0000 (20:44 +0100)]
Split brain: Push correct view to dgit repos server

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: Test suite: quilt-gbp test: More
Ian Jackson [Sun, 4 Sep 2016 17:23:09 +0000 (18:23 +0100)]
dgit: Test suite: quilt-gbp test: More

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: lrfetchrefs: Delete unneeded fetched refs, etc.
Ian Jackson [Sun, 11 Sep 2016 17:43:37 +0000 (18:43 +0100)]
dgit: lrfetchrefs: Delete unneeded fetched refs, etc.

Fetch only the refs we (think we) are going to use, and delete the
lrfetchrefs (`refs/dgit-fetch/...') versions of those we give another
name to.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: Implement `git-fetch --no-insane'
Ian Jackson [Wed, 7 Sep 2016 20:41:03 +0000 (21:41 +0100)]
dgit: Implement `git-fetch --no-insane'

git-fetch has some very poor behaviours.  Implement a non-insane
version.

We are going to want to not fetch things we aren't going to use, and
this is necessary for that.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: tag-updates: Do not assert a that dgit-fetch/ ref exists
Ian Jackson [Sun, 11 Sep 2016 16:49:26 +0000 (17:49 +0100)]
Test suite: tag-updates: Do not assert a that dgit-fetch/ ref exists

We don't actually want dgit to leave these lying around unless it has
to.  So don't insist on that.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: inarchivecopy: Is finished
Ian Jackson [Wed, 31 Aug 2016 17:04:10 +0000 (18:04 +0100)]
Test suite: inarchivecopy: Is finished

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: inarchivecopy: use t-sametree-parent
Ian Jackson [Tue, 30 Aug 2016 00:37:43 +0000 (01:37 +0100)]
Test suite: inarchivecopy: use t-sametree-parent

Otherwise different history between fetch and clone breaks the test.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Provide t-sametree-parent
Ian Jackson [Tue, 30 Aug 2016 00:37:06 +0000 (01:37 +0100)]
Test suite: Provide t-sametree-parent

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: need to clean up lrfetchrefs
Ian Jackson [Sun, 14 Aug 2016 11:40:58 +0000 (12:40 +0100)]
TODO.BRANCH: need to clean up lrfetchrefs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: inarchivecopy: More work
Ian Jackson [Sun, 14 Aug 2016 11:10:32 +0000 (12:10 +0100)]
Test suite: inarchivecopy: More work

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: inarchivecopy: More work
Ian Jackson [Wed, 10 Aug 2016 20:49:01 +0000 (21:49 +0100)]
Test suite: inarchivecopy: More work

Select specifically 1.3 for first test, and do a clone

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: inarchivecopy: New test (does not pass yet)
Ian Jackson [Sun, 7 Aug 2016 19:53:23 +0000 (20:53 +0100)]
Test suite: inarchivecopy: New test (does not pass yet)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: provide for x-dgit-unfinished restriction
Ian Jackson [Mon, 5 Sep 2016 23:10:23 +0000 (00:10 +0100)]
Test suite: provide for x-dgit-unfinished restriction

This will allow us to add tests which fail or are broken, without
causing the test suite as a whole to fail.  When the test is good, the
restrction should be removed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: Add a comment explaining import discard
Ian Jackson [Mon, 29 Aug 2016 23:06:14 +0000 (00:06 +0100)]
dgit: Add a comment explaining import discard

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: Clarify some messages about archive/local skew
Ian Jackson [Mon, 29 Aug 2016 23:05:46 +0000 (00:05 +0100)]
dgit: Clarify some messages about archive/local skew

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: New fetch algorithm - try to tolerate in-archive copies
Ian Jackson [Sun, 14 Aug 2016 16:55:44 +0000 (17:55 +0100)]
dgit: New fetch algorithm - try to tolerate in-archive copies

Big comment explains.

Amongst other things:
 * Introduce the mergeinfo concept
 * Abolish fetchspec in favour of lrfetchref
 * Synthesize a pseudo-merge linking the archive's .dsc with the dgit
   server's git branch, as appropriate.
 * Introduce mergeinfo_version.

I have tried to ensure that where the import done by previous versions
of dgit would be correct, the new import is the same.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Remove refs/remotes/dgit/dgit/sid from pari-extra worktree
Ian Jackson [Sun, 14 Aug 2016 17:28:10 +0000 (18:28 +0100)]
Test suite: Remove refs/remotes/dgit/dgit/sid from pari-extra worktree

This, effectively, simulates a previous fetch of something.  Do this
in the actual tests instead: in this case, only necessary in
fetch-localgitonly.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: examplegit: make "new" branch be 2.x
Ian Jackson [Sun, 14 Aug 2016 11:10:14 +0000 (12:10 +0100)]
Test suite: examplegit: make "new" branch be 2.x

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: t-commit: honour $majorv for major version
Ian Jackson [Sun, 14 Aug 2016 11:09:32 +0000 (12:09 +0100)]
Test suite: t-commit: honour $majorv for major version

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Honour t_dgit_xopts
Ian Jackson [Sun, 24 Jul 2016 18:56:29 +0000 (19:56 +0100)]
Test suite: Honour t_dgit_xopts

No callers.  This may come in useful, though, at some point.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: examplegit: Make two pushes to unstable
Ian Jackson [Wed, 10 Aug 2016 20:48:03 +0000 (21:48 +0100)]
Test suite: examplegit: Make two pushes to unstable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: examplegit: Save mirror as part of setup
Ian Jackson [Sun, 7 Aug 2016 19:52:38 +0000 (20:52 +0100)]
Test suite: examplegit: Save mirror as part of setup

incoming has nothing in it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: t-setup-*: Fix lock path
Ian Jackson [Sun, 7 Aug 2016 19:52:11 +0000 (20:52 +0100)]
Test suite: t-setup-*: Fix lock path

Needs to be not in a directory which may not exist yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Provide t-setup-* machinery
Ian Jackson [Sun, 7 Aug 2016 19:19:35 +0000 (20:19 +0100)]
Test suite: Provide t-setup-* machinery

Setups are, essentially, prefixes to test cases.  We arrange to be
able to reuse their state (as explicitly recorded in t-setup-done), so
that manual runs of the test suite can be faster.

We save the tmp base directory (the directory shared by tests), if
there is one.  That will be used for cacheing of setups.  And we save
the environment in form we can use xargs and env to restore.

We use a conventional with-lock-ex and stamp file pattern for the
cache.  The IMPORT file (containing shell variables) doubles as the
stamp.

The setup execution rune is exciting.  This mostly results from the
fact that we want xargs to pass all the env vars to env, and that
xargs cannot be persuaded to append fixed arguments to the arguments
read from its input file.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: examplegit setup script
Ian Jackson [Fri, 5 Aug 2016 19:38:59 +0000 (20:38 +0100)]
Test suite: examplegit setup script

We are going to have `setup' scripts which explain how to set up the
preconditions for one or more tests.  This is the first one.

Right now it runs to completion, generating its deliverables in $tmp,
but then crashes due to the as-yet-unimplemented t-setup-done call.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: t-commit: Permit specification of the suite in $3
Ian Jackson [Fri, 5 Aug 2016 19:37:32 +0000 (20:37 +0100)]
Test suite: t-commit: Permit specification of the suite in $3

This also means that we need to default $2 with ${2:-} since callers
want need to pass an empty value for the version, to get the default.

No functional change since none of the call sites use this yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: t-pushed-good: Support other suites
Ian Jackson [Fri, 5 Aug 2016 19:34:13 +0000 (20:34 +0100)]
Test suite: t-pushed-good: Support other suites

Honour $2 being the suite codename, defaulting to sid.

No functional change, since no-one passes this argument right now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: t-archive-none: Support multiple suites
Ian Jackson [Fri, 5 Aug 2016 19:32:34 +0000 (20:32 +0100)]
Test suite: t-archive-none: Support multiple suites

t-archive-none now honours `suitespecs', which defaults to just
`sid:unstable'.

No overall functional change since no-one sets suitespecs to a
non-default value.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Synthetic ff is not to do with $tag, really
Ian Jackson [Sun, 31 Jul 2016 18:29:37 +0000 (19:29 +0100)]
TODO.BRANCH: Synthetic ff is not to do with $tag, really

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Have checked all uses of $split_brain
Ian Jackson [Sun, 31 Jul 2016 18:28:16 +0000 (19:28 +0100)]
TODO.BRANCH: Have checked all uses of $split_brain

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Update following split tag work
Ian Jackson [Sun, 31 Jul 2016 18:14:09 +0000 (19:14 +0100)]
TODO.BRANCH: Update following split tag work

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: More notes about our plans
Ian Jackson [Sun, 22 May 2016 17:36:13 +0000 (18:36 +0100)]
TODO.BRANCH: More notes about our plans

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit brain: Test case: Do push
Ian Jackson [Sun, 31 Jul 2016 18:02:44 +0000 (19:02 +0100)]
Split brain: Test case: Do push

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit brain: TODOs
Ian Jackson [Sun, 31 Jul 2016 18:02:32 +0000 (19:02 +0100)]
Split brain: TODOs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Push the maintainer view tag, where supported
Ian Jackson [Sun, 31 Jul 2016 17:49:55 +0000 (18:49 +0100)]
Split tags: Push the maintainer view tag, where supported

We introduce a new `maint' possibility in to the dgit-tag-format
access cfg list, presence of which indicates that the receiver is
content to receive DEP-14-style maintainer-view (ie, non-dgit0 tags.

For now, we default this to true.  However, repos handled by
dgit-repos-server cannot currently cope with this, because:
 * dgit-repos-server currently tries to be compatible with old
   dgits which send DEP-14-named dgit tags;
 * dgit-repos-server doesn't currently permit the creation of
   `extraneous' (ie, non-dgit) tags and branches.

So for Debian, we do not set this flag.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Genrate maintainer-view tag too
Ian Jackson [Sun, 31 Jul 2016 17:41:02 +0000 (18:41 +0100)]
Split tags: Genrate maintainer-view tag too

push_tagwants gets a new argument, $maintviewhead, which is defined
iff the quilt mode means we want split tags.  It then specifies the
generation of both tags.

push_mktags gains the ability to make the new `maint' view tag (and
checks that the view is not something else unexpected).

Introduce a function debiantag_maintview for calculating the
maintainer's idea of the tag.  Currently we use DEP-14 encoding (and
this function is a clone-and-hack of Dgit.pm::debiantag_old, but
perhaps we should do something more complicated (depending on the
quilt mode).

For now we do not push the maint view tag anywhere.  The ability to do
that, where appropriate, will come in a moment.

This commit introduces protocol version 4, which includes the new
`maint-view' param.  When have a split brain quilt mode, we need to be
sure that we're using protocol version 4 or out peer may not honour
this, resulting in an annoying failure later (the responder sending a
different number of tags to the number expected).

We also have to check that we're using the new tag format (or we might
want to try to generate two different tags with the same name, which
is madness).

When the quilt mode is not a split brain one, this whole commit should
produce no overall functional change (even though a higher protocol
version may be negotiated).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Preparation: Rename tag variables etc. in dopush
Ian Jackson [Sun, 31 Jul 2016 17:32:11 +0000 (18:32 +0100)]
Split tags: Preparation: Rename tag variables etc. in dopush

We are going to have different branches at once.  Rename some
variables to permit this distinction.

We have $actualhead (whatever HEAD is), $dgithead (the dgit view), and
$maintviewhead (the maintainer's view if different, or undef if not0.

Change the existing references.  Also change one reference to HEAD to
$dgithead: when we update the local tracking ref for the dgit view, we
need to use $dgitview.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Preparation: Reorganise tagwants and mktags
Ian Jackson [Sun, 31 Jul 2016 16:57:11 +0000 (17:57 +0100)]
Split tags: Preparation: Reorganise tagwants and mktags

We are going to want to generate two tags.  The current code structure
is not really set up for this.  Also the knowledge of what tags are
being made needs to be used both in dopush and in the push responder.

So:
 * Introduce push_tagwants, which calculates which tags we are going
   to be making, including some details of them.
 * `View' indicates which tag this is.  For now there is only one,
   `dgit'.  But the tags are going to be in a defined order - or,
   at least, the `dgit' tag will come first.
 * Have push_parse_changelog no longer return the single tag name,
   and abolish the corresponding $i_tag varaiable.
 * push_mktag bcomes push_mktags and takes much of its instruction
   from @$tagwants.
 * push_mktags does more than just making tags - it also updates
   the dsc, and does some checks, so it needs to fish the relevant
   object id out of the dgit view tag.
 * $mktag in push_tagwants can now operate on a tagwant, and
   the tag-making part of push_mktags just iterates over the tagwants.
 * The filename plumbing in dopush is somewhat generalised: we
   collect the filenames out of push_mtags or responder_receive_files,
   and then substitute them into the tagwants.
 * The tag checking iterates over the tagwants.
 * The push spec computation iterates over the tagwants.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Preparation: Break out (and fix) need_tagformat
Ian Jackson [Sun, 31 Jul 2016 16:47:44 +0000 (17:47 +0100)]
Split tags: Preparation: Break out (and fix) need_tagformat

No major functional change.

However, we do preserve the previous override value, so that
need_tagformat's caller is happy, we still override the access
configuration.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Preparation: Break out access_cfg_tagformats
Ian Jackson [Sun, 31 Jul 2016 16:45:18 +0000 (17:45 +0100)]
Split tags: Preparation: Break out access_cfg_tagformats

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Preparation: move select_tagformat into a new section
Ian Jackson [Sun, 31 Jul 2016 16:43:59 +0000 (17:43 +0100)]
Split tags: Preparation: move select_tagformat into a new section

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit tags: Introduce $mktag in push_mktag
Ian Jackson [Sat, 30 Jul 2016 14:32:28 +0000 (15:32 +0100)]
Split tags: Introduce $mktag in push_mktag

push_mktag is going to want to become push_mktags, and make perhaps
two tags.

For now, break the actual tag-making out into a subref.  Rename the
arguments to push_mktag to ensure we caught all the references in
$mktag.

push_mktag now wants to return an array; make sure that the call sites
all give it array context.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Double check agreement in rpush protocol
Ian Jackson [Sat, 30 Jul 2016 12:13:26 +0000 (13:13 +0100)]
Tag change: Double check agreement in rpush protocol

Send the tag format as a param and check that it is the same at both
ends.  This check _ought_ not ever to fail, but I want to be sure.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Rename $tagformat to $tagformat_want
Ian Jackson [Sat, 30 Jul 2016 11:49:50 +0000 (12:49 +0100)]
Tag change: Rename $tagformat to $tagformat_want

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Recognise {oldtag,newtag}-clone-nogit
Ian Jackson [Sun, 24 Jul 2016 19:09:13 +0000 (20:09 +0100)]
TODO.BRANCH: Recognise {oldtag,newtag}-clone-nogit

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Want to test upgrade smoothness
Ian Jackson [Sun, 24 Jul 2016 19:08:54 +0000 (20:08 +0100)]
TODO.BRANCH: Want to test upgrade smoothness

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Have grepped tests/lib for tag
Ian Jackson [Sun, 24 Jul 2016 19:07:09 +0000 (20:07 +0100)]
TODO.BRANCH: Have grepped tests/lib for tag

Well, we have done this well enough that t-pushed-good works in
newtag-clone-nogit.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: Some desires for protovsn 4
Ian Jackson [Sun, 24 Jul 2016 19:06:37 +0000 (20:06 +0100)]
TODO.BRANCH: Some desires for protovsn 4

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH: "previously" is fine.
Ian Jackson [Sun, 24 Jul 2016 19:02:57 +0000 (20:02 +0100)]
TODO.BRANCH: "previously" is fine.

git_fetch_us fetches all of refs/heads and refs/tags into dgit-fetch,
and then with deliberately_not_fast_forward we process each of those.

This is correct.  This is for replay protection and for this purpose
it doesn't matter whether the tags we are stopping being unwound are
dgit tags or something else.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Canonicalise json output when generating aq
Ian Jackson [Sun, 14 Aug 2016 11:47:33 +0000 (12:47 +0100)]
Test suite: Canonicalise json output when generating aq

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: run-all: record output
Ian Jackson [Sun, 14 Aug 2016 11:19:32 +0000 (12:19 +0100)]
Test suite: run-all: record output

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: Use GIT_COMMITTER_DATE for automatic patch
Ian Jackson [Sun, 14 Aug 2016 17:37:59 +0000 (18:37 +0100)]
dgit: Use GIT_COMMITTER_DATE for automatic patch

When automatically generating quilt patch, honour GIT_COMMITTER_DATE
for filename creation (makes filename deterministic in test suite).

3 years agoTest suite: Test pushing with forcing old and new tag format
Ian Jackson [Sun, 24 Jul 2016 18:57:33 +0000 (19:57 +0100)]
Test suite: Test pushing with forcing old and new tag format

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Calculate desired tag format
Ian Jackson [Sun, 24 Jul 2016 17:56:14 +0000 (18:56 +0100)]
Tag change: Calculate desired tag format

Introduce machinery for deciding what format tag to make, during push.
The computation is slightly ad-hoc.

Currently it always returns `old' and does as before, so no overall
functional change with existing configs and existing command lines.

Reserve protocol version 4 for new tag support.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: dgit: Fetch both old ane new format tags
Ian Jackson [Sun, 24 Jul 2016 18:52:21 +0000 (19:52 +0100)]
Tag change: dgit: Fetch both old ane new format tags

We are going to want to know about all of these.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Test suite: Introduce $tagpfx
Ian Jackson [Sun, 17 Jul 2016 14:37:07 +0000 (15:37 +0100)]
Tag change: Test suite: Introduce $tagpfx

Currently this is `test-dummy' (the distro the tests work with).

Have checked that after this commit
   find tests -type f | xargs perl -i~ -pe 's/\$tagpfx/test-dummy/g'
puts everything back.  (This does not prove I have changed the right
set of occurrences, but it does suggest that each actual change is
good.)

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Update dgit-repos-policy-debian
Ian Jackson [Sun, 17 Jul 2016 14:16:06 +0000 (15:16 +0100)]
Tag change: Update dgit-repos-policy-debian

The only place where we call debiantag, and the only place where we
know about tag names, is in vsn_in_our_history.  We need to change it
to query multiple tags.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Update dgit-repos-server
Ian Jackson [Sun, 17 Jul 2016 14:14:00 +0000 (15:14 +0100)]
Tag change: Update dgit-repos-server

Change the calls to debiantag_old to changes to debiantags, and the
regexp to tolerate either tag name.

We need an additional check that we are not receiving the tag named by
debiantag_new when debiantag_old already exists.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Provide debiantags in Dgit.pm
Ian Jackson [Sun, 17 Jul 2016 14:13:01 +0000 (15:13 +0100)]
Tag change: Provide debiantags in Dgit.pm

No callers yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Make git_for_each_ref support multiple patterns
Ian Jackson [Sun, 17 Jul 2016 13:25:50 +0000 (14:25 +0100)]
Tag change: Make git_for_each_ref support multiple patterns

By passing $patterns= [ ... ].  No functional change yet as no call
site does this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Declare intent in docs etc.
Ian Jackson [Sun, 17 Jul 2016 13:21:42 +0000 (14:21 +0100)]
Tag change: Declare intent in docs etc.

Provide debiantag_new as well as debiantag_old.  Change the docs
and an important comment.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTag change: Rename debiantag to debiantag_old
Ian Jackson [Sun, 17 Jul 2016 12:51:46 +0000 (13:51 +0100)]
Tag change: Rename debiantag to debiantag_old

We are going to change the tag name of the main signed tag used by
dgit to signal the user's intent to the archive server.

Prepare for this by changing debiantag to debiantag_old and changing
all call sites outside dgit itself.

dgit will want to be able to generate either, depending on whether
it's cooperating in an rpush with a new or old dgit so reintroduce a
wrapper called debiantag there.  This will also allow us to have dgit
generate old tags for testing.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTODO.BRANCH search whole tree for "tag"
Ian Jackson [Sun, 17 Jul 2016 13:12:56 +0000 (14:12 +0100)]
TODO.BRANCH search whole tree for "tag"

3 years agochangelog: Document test suite better info
Ian Jackson [Sun, 24 Jul 2016 18:41:07 +0000 (19:41 +0100)]
changelog: Document test suite better info

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Print better info on t-ref-same failure
Ian Jackson [Sun, 24 Jul 2016 18:40:20 +0000 (19:40 +0100)]
Test suite: Print better info on t-ref-same failure

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: Print better info on failures
Ian Jackson [Sun, 24 Jul 2016 18:40:06 +0000 (19:40 +0100)]
Test suite: Print better info on failures

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodgit: rpush protocol comment: Add some missing protocol elements
Ian Jackson [Sat, 30 Jul 2016 12:12:12 +0000 (13:12 +0100)]
dgit: rpush protocol comment: Add some missing protocol elements

progress, supplementary-message, previously, and param csuite, were
all missing.  Document them.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDgit.pm: cmdoutput: Handle undef in arg crash better
Ian Jackson [Sun, 31 Jul 2016 17:12:59 +0000 (18:12 +0100)]
Dgit.pm: cmdoutput: Handle undef in arg crash better

Use `confess' which produces a stack trace.  And don't forget to use
Data::Dumper;

Bug introduced in e6ce71a87a1c "Move various useful functions into
Dgit.pm [...]".

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSplit brain: When pushing, find the dgit view in the cache
Ian Jackson [Sat, 16 Jul 2016 23:12:35 +0000 (00:12 +0100)]
Split brain: When pushing, find the dgit view in the cache

We now do set $split_brain, and we don't do anythig with the cached
dgit view, so we'll crash at the die, in a moment.

3 years agoInnards: Improve mktree_in_ud_from_only_subdir message
Ian Jackson [Sat, 16 Jul 2016 23:00:06 +0000 (00:00 +0100)]
Innards: Improve mktree_in_ud_from_only_subdir message

When it finds multiple subdirs, print them.