chiark / gitweb /
dgit.git
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.

3 years agoSubprocess error handling: Initialise $? to -1
Ian Jackson [Sat, 16 Jul 2016 22:10:27 +0000 (23:10 +0100)]
Subprocess error handling: Initialise $? to -1

When system(3perl) fails due to syscall error, it sets only $!.  When
it succeeds it sets only $? and sometimes trashes $!.  Conversely,
close of a popened filehandle always sets both in all cases.

Document this in a comment.

So when using system and relying on $?/$! (rather than looking at
system's return value), such as when about to use failedcmd, it's
necessary to initialise $? to -1.

Fix the three call sites where system might be followed by failedcmd
but this wasn't done.

3 years agoSubprocess error handling: Fix when divert check fails
Ian Jackson [Sat, 16 Jul 2016 22:35:21 +0000 (23:35 +0100)]
Subprocess error handling: Fix when divert check fails

If the remote command failed, do not try to match the undef value
against the various regexps.

3 years agoSubprocess error handling: Do not call faildcmd when open fails
Ian Jackson [Sat, 16 Jul 2016 22:34:32 +0000 (23:34 +0100)]
Subprocess error handling: Do not call faildcmd when open fails

failecmd wants to look at $? too and anyway the full command is not of
much interest in these cases.

3 years agoSplit brain: Fix grammar in a message
Ian Jackson [Sat, 16 Jul 2016 17:22:07 +0000 (18:22 +0100)]
Split brain: Fix grammar in a message

3 years agoSplit brain: In dopush, get HEAD earlier (nfc)
Ian Jackson [Sat, 16 Jul 2016 17:20:57 +0000 (18:20 +0100)]
Split brain: In dopush, get HEAD earlier (nfc)

3 years agoSplit brain: Do not look at all of %INC for cache key
Ian Jackson [Sat, 16 Jul 2016 17:19:36 +0000 (18:19 +0100)]
Split brain: Do not look at all of %INC for cache key

Look only at dgit and Debian/Dgit.

The prompt for this is that some of our submodules seem to dynamically
load some of their components depending on what dgit does, making the
cache key unstable.

3 years agoquilt innards: Change calling convention for quilt_check_splitbrain_cache
Ian Jackson [Sat, 16 Jul 2016 16:59:07 +0000 (17:59 +0100)]
quilt innards: Change calling convention for quilt_check_splitbrain_cache

3 years agoquilt innards: Break out quilt_check_splitbrain_cache (nfc)
Ian Jackson [Sat, 16 Jul 2016 16:50:17 +0000 (17:50 +0100)]
quilt innards: Break out quilt_check_splitbrain_cache (nfc)

3 years agoquilt innards: Break out uilt_make_fake_dsc (nfc)
Ian Jackson [Sat, 16 Jul 2016 16:35:37 +0000 (17:35 +0100)]
quilt innards: Break out uilt_make_fake_dsc (nfc)

3 years agoquilt innards: Remove a couple of stray blank lines
Ian Jackson [Sat, 16 Jul 2016 16:31:58 +0000 (17:31 +0100)]
quilt innards: Remove a couple of stray blank lines

3 years agoquilt innards: Fix a formatting glitch
Ian Jackson [Sat, 16 Jul 2016 16:15:26 +0000 (17:15 +0100)]
quilt innards: Fix a formatting glitch

3 years agoQuilt mode reporting: Only print warning about quilt once
Ian Jackson [Sat, 16 Jul 2016 15:59:51 +0000 (16:59 +0100)]
Quilt mode reporting: Only print warning about quilt once

3 years agoTest suite: quilt-gbp: New test (not yet complete)
Ian Jackson [Sat, 4 Jun 2016 21:23:47 +0000 (22:23 +0100)]
Test suite: quilt-gbp: New test (not yet complete)

This test does not yet do all that we want, but it does some things
and then exits 0.

The current intent for the future is written in prose in the rest of
the file.

3 years agoTest suite: t-gbp-example-prep: Arrange to be FF from the archive
Ian Jackson [Sat, 16 Jul 2016 11:52:47 +0000 (12:52 +0100)]
Test suite: t-gbp-example-prep: Arrange to be FF from the archive

Otherwise pushes will necessarily (spuriously) fail.

3 years agoWhen synthesing a commit from a .dsc from the archive, stop internal git reset from...
Ian Jackson [Sat, 16 Jul 2016 11:52:05 +0000 (12:52 +0100)]
When synthesing a commit from a .dsc from the archive, stop internal git reset from printing a confusing message about HEAD.

3 years agoSplit brain: Use GZIP -1n to avoid spurious timestamp
Ian Jackson [Sat, 16 Jul 2016 11:33:51 +0000 (12:33 +0100)]
Split brain: Use GZIP -1n to avoid spurious timestamp

Otherwise the cache entry's .dsc contains the hash of a fake
debian.tar.gz which has had a timestamp put in it by gzip, defeating
the cache.

3 years agoSplit brain: Improve and rationalise progress messages
Ian Jackson [Sat, 16 Jul 2016 11:33:31 +0000 (12:33 +0100)]
Split brain: Improve and rationalise progress messages

3 years agoSplit brain: Provide --gbp= and --gbp:
Ian Jackson [Sat, 16 Jul 2016 11:30:42 +0000 (12:30 +0100)]
Split brain: Provide --gbp= and --gbp:

Not documented yet.

3 years agoSplit brain: With patches-unapplied trees, apply before running rules
Ian Jackson [Sat, 16 Jul 2016 10:54:45 +0000 (11:54 +0100)]
Split brain: With patches-unapplied trees, apply before running rules

Everywhere we invoke dpkg-buildpackage, check if we need to apply the
patches.  And at the end of every command that might have done this,
check if we did, and unapply them if so.

We don't try to unapply patches in case of error.  That seems likely
to be quite fragile.

Print a warning when we apply patches, suggesting ways to avoid the
need.

3 years agoSplit brain: Show progress message when dgit view created OK
Ian Jackson [Sat, 16 Jul 2016 10:54:06 +0000 (11:54 +0100)]
Split brain: Show progress message when dgit view created OK

3 years agoSplit brain: Do not leave STDOUT redirected to /dev/null (!)
Ian Jackson [Sat, 16 Jul 2016 10:53:08 +0000 (11:53 +0100)]
Split brain: Do not leave STDOUT redirected to /dev/null (!)

We use runcmd shell_cmd for gbp pq import, and the other commands not
produce undesirable output.

3 years agoSplit brain: Use `gbp pq' (which exists) not `gbp-pq' (which doesn't)
Ian Jackson [Sat, 16 Jul 2016 10:39:05 +0000 (11:39 +0100)]
Split brain: Use `gbp pq' (which exists) not `gbp-pq' (which doesn't)

3 years agoTest suite: unapplied-pq2qc: leave us on the qc/ branch
Ian Jackson [Sun, 10 Jul 2016 18:48:47 +0000 (19:48 +0100)]
Test suite: unapplied-pq2qc: leave us on the qc/ branch

The patch queue branch is not really very useful.  Certainly, the
build tests will require the patch queue branch.

3 years agoSplit brain: Include quilt mode in cache key
Ian Jackson [Sun, 10 Jul 2016 18:47:57 +0000 (19:47 +0100)]
Split brain: Include quilt mode in cache key

This can make a radical difference!

3 years agoSplit brain: Fix unapplied tree handling
Ian Jackson [Sun, 10 Jul 2016 18:46:40 +0000 (19:46 +0100)]
Split brain: Fix unapplied tree handling

Do the quiltify_splitbrain_needed if there _are_ patches, not if there
aren't.  And if we're told it was an unapplied tree, check that HEAD
and orig are indeed the same (excluding debian/*, of course) and print
a useful message if not.

3 years agoTest suite: When sbuild log file missing, make a note
Ian Jackson [Sun, 3 Jul 2016 23:30:46 +0000 (00:30 +0100)]
Test suite: When sbuild log file missing, make a note

This updates "Test suite: When sbuild fails, do not crash", to arrange
that in this situation we do leave a message in the $bmlog, where it
will be reported (eg) by diff.  This makes debugging less confusing in
cases where the log is indeed missing.

3 years agoTest suite: Provide t-gbp-example-prep [FOLD INTO QUILT-GBP TEST?]
Ian Jackson [Sat, 16 Jul 2016 14:57:01 +0000 (15:57 +0100)]
Test suite: Provide t-gbp-example-prep [FOLD INTO QUILT-GBP TEST?]

This function is useful for setting up a test case --quilt=gbp working
tree and corresponding archive contents, ready for substantive tests.

3 years agoTest suite: Move bm-quirk-sbuild-after-act to lib-build-modes
Ian Jackson [Sun, 3 Jul 2016 23:00:55 +0000 (00:00 +0100)]
Test suite: Move bm-quirk-sbuild-after-act to lib-build-modes

This will allow other tests to check dgit sbuild.

3 years agoTest suite: build-modes: Move sbuild knowledge to lib
Ian Jackson [Sun, 3 Jul 2016 22:57:50 +0000 (23:57 +0100)]
Test suite: build-modes: Move sbuild knowledge to lib

Teach bm-guess-e-source-e-targets about sbuild, so this knowledge can
be reused.

3 years agoTest suite: build-modes: Move `build-source' knowledge to lib
Ian Jackson [Sun, 3 Jul 2016 22:56:50 +0000 (23:56 +0100)]
Test suite: build-modes: Move `build-source' knowledge to lib

Teach bm-guess-e-source-e-targets about dgit build-source, so this
knowledge can be reused.

3 years agoTest suite: Break out bm-prep-ownpackage-branches
Ian Jackson [Sun, 3 Jul 2016 22:55:47 +0000 (23:55 +0100)]
Test suite: Break out bm-prep-ownpackage-branches

We are going to want to run some build modes tests on other exciting
trees.

3 years agoTest suite: quilt gbp: Provide example worktree tarball
Ian Jackson [Sat, 16 Jul 2016 14:53:41 +0000 (15:53 +0100)]
Test suite: quilt gbp: Provide example worktree tarball

This working tree has some patch queues etc. in it, which will be
useful for testing --quilt=gbp.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTest suite: unapplied-pq2qc: move into lib as a t- subroutine
Ian Jackson [Sun, 19 Jun 2016 15:16:12 +0000 (16:16 +0100)]
Test suite: unapplied-pq2qc: move into lib as a t- subroutine

3 years agoTest suite: Provide tests/unapplied-pq2qc
Ian Jackson [Sat, 4 Jun 2016 21:22:41 +0000 (22:22 +0100)]
Test suite: Provide tests/unapplied-pq2qc

Utility script for invoking gbp pq.  I think I will want to swallow
this into a t-* function in tests/lib.

3 years agoProvide 3.0 (quilt) patches-unapplied with .gitignore test case
Ian Jackson [Mon, 7 Dec 2015 00:45:21 +0000 (00:45 +0000)]
Provide 3.0 (quilt) patches-unapplied with .gitignore test case

3 years agoSplit build: Add a bit more debugging output
Ian Jackson [Sun, 6 Dec 2015 23:36:24 +0000 (23:36 +0000)]
Split build: Add a bit more debugging output

3 years agoSplit brain: Run source build in dgit view directory
Ian Jackson [Sun, 6 Dec 2015 20:58:13 +0000 (20:58 +0000)]
Split brain: Run source build in dgit view directory

And, after the source build is done, copy the resulting files out into
the invocation directory's parent, where people expect to find them.

3 years agoSplit build: Split clean from source build in split build mode
Ian Jackson [Sun, 6 Dec 2015 20:12:20 +0000 (20:12 +0000)]
Split build: Split clean from source build in split build mode

3 years agoSplit brain: some work on integration into the rest of dgit
Ian Jackson [Sat, 28 Nov 2015 17:43:33 +0000 (17:43 +0000)]
Split brain: some work on integration into the rest of dgit

* Move the fast forward die to where we will need to make the
  synthetic commit, so that the tree equality check is done on the
  thing we will actually push.

* Crash if we are trying to do split brain without split build.
  (This should never happen.)

* Set split build if we need split brain.

3 years agodgit: Rename $suppress_clean to $clean_using_builder (nfc)
Ian Jackson [Sat, 4 Jun 2016 17:31:53 +0000 (18:31 +0100)]
dgit: Rename $suppress_clean to $clean_using_builder (nfc)

This variable name was very confusing.  Also, add a comment explaining
the semantics.

3 years agoSplit brain: Quieten dgit-view checkout
Ian Jackson [Sun, 6 Dec 2015 20:57:55 +0000 (20:57 +0000)]
Split brain: Quieten dgit-view checkout

3 years agoSplit brain: introduce quiltmode_splitbrain() (nfc)
Ian Jackson [Sun, 29 Nov 2015 18:29:42 +0000 (18:29 +0000)]
Split brain: introduce quiltmode_splitbrain() (nfc)

3 years agoSplit brain: Memoise (cache) split brain dgit-view in a reflog
Ian Jackson [Sat, 4 Jun 2016 16:10:17 +0000 (17:10 +0100)]
Split brain: Memoise (cache) split brain dgit-view in a reflog

3 years agoSplit brain: Actually get gbp pq output back onto dgit-view branch
Ian Jackson [Sat, 28 Nov 2015 17:40:53 +0000 (17:40 +0000)]
Split brain: Actually get gbp pq output back onto dgit-view branch

And explain why in a comment.

3 years agoSplit brain: Transfer gbp-pq patch application output to dgit-view branch
Ian Jackson [Sat, 4 Jun 2016 16:08:23 +0000 (17:08 +0100)]
Split brain: Transfer gbp-pq patch application output to dgit-view branch

This code does not work properly yet; it will be fixed soon.

3 years agoSplit brain: Generate .gitignore patch in deterministic order
Ian Jackson [Sat, 4 Jun 2016 16:03:41 +0000 (17:03 +0100)]
Split brain: Generate .gitignore patch in deterministic order

3 years agoSplit brain: Actually generate .gitignore patch
Ian Jackson [Sat, 4 Jun 2016 16:01:40 +0000 (17:01 +0100)]
Split brain: Actually generate .gitignore patch

Close our FH onto the file, and run git diff to fill it with the
actual diff.  Add the file to series.  Use git add and git commit to
commit the patch to the private git branch.

Now most of the code to generate the .gitignore properly is present, I
think, but not debugged.

3 years agoSplit brain: Create debian/patches in case it does not exist
Ian Jackson [Sat, 4 Jun 2016 16:00:51 +0000 (17:00 +0100)]
Split brain: Create debian/patches in case it does not exist

When we need to make the .gitignore patch, there may not yet be any
debian/patches directory.

3 years agoSplit brain: Add [dgit version ] tag to autogenerated .gitignore patch header
Ian Jackson [Sat, 4 Jun 2016 16:00:08 +0000 (17:00 +0100)]
Split brain: Add [dgit version ] tag to autogenerated .gitignore patch header

So far we still don't generate the patch.

3 years agoSplit brain: Provide a lot more information to quiltify_splitbrain (nfc)
Ian Jackson [Sat, 4 Jun 2016 15:59:26 +0000 (16:59 +0100)]
Split brain: Provide a lot more information to quiltify_splitbrain (nfc)

It is going to need this extra info in a moment.

3 years agoSplit brain: Provide optional $ignorenamesr argument to quiltify_trees_differ
Ian Jackson [Sat, 4 Jun 2016 15:57:35 +0000 (16:57 +0100)]
Split brain: Provide optional $ignorenamesr argument to quiltify_trees_differ

We are going to need this information to construct the substantive
diff for the .gitignores patch.

3 years agoSplit brain: quiltify_trees_differ: document $ignorenamesr
Ian Jackson [Sat, 4 Jun 2016 15:56:06 +0000 (16:56 +0100)]
Split brain: quiltify_trees_differ: document $ignorenamesr

3 years agoSplit brain: Print $unapplied tree hash to debug log, too
Ian Jackson [Wed, 25 Nov 2015 22:44:45 +0000 (22:44 +0000)]
Split brain: Print $unapplied tree hash to debug log, too

3 years agoSplit brain: Start work on generating gitignore patch
Ian Jackson [Sat, 4 Jun 2016 15:49:20 +0000 (16:49 +0100)]
Split brain: Start work on generating gitignore patch

Generate a patch header, for now.  Still not finished.

3 years agoSplit brain: Move GIT_COMMITTER_* setting to quiltify_splitbrain toplevel (nfc)
Ian Jackson [Sat, 4 Jun 2016 15:48:43 +0000 (16:48 +0100)]
Split brain: Move GIT_COMMITTER_* setting to quiltify_splitbrain toplevel (nfc)

We want this to apply to any commits we use git to make, not just
gbp-pq.

3 years agoSplit brain: Further improvements to split brain patch application
Ian Jackson [Sat, 4 Jun 2016 15:45:06 +0000 (16:45 +0100)]
Split brain: Further improvements to split brain patch application

* Direct gbp-pq's stdout to /dev/null
* Specify GIT_COMMITER_* so that the results are reproducible
* Detect .gitignore problem

3 years agoSplit brain: Pass $clogp to quiltify_splitbrain (nfc)
Ian Jackson [Sat, 4 Jun 2016 15:44:19 +0000 (16:44 +0100)]
Split brain: Pass $clogp to quiltify_splitbrain (nfc)

We are going to want this in a moment.

3 years agoSplit brain: Make clogp_authline capable of returning individual pieces (nfc)
Ian Jackson [Thu, 19 Nov 2015 01:10:47 +0000 (01:10 +0000)]
Split brain: Make clogp_authline capable of returning individual pieces (nfc)

We are going to want this (so that we can set GIT_... variables to the
pieces to make git construct commits the way we want).

Both current call sites provide scalar context, so no functional
change.

3 years agoSplit brain: Break out $git_authline_re
Ian Jackson [Thu, 19 Nov 2015 01:10:23 +0000 (01:10 +0000)]
Split brain: Break out $git_authline_re

This will make it a bit easier to reuse it.  Actually AFAICT it turns
out (looking at the rest of the branch) that this is not needed, but
it's nicer for the future I think.