summaryrefslogtreecommitdiff
path: root/dgit
Commit message (Collapse)AuthorAge
* dgit: Some extra error reports for wrong split brain modeIan Jackson2016-09-26
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Allow --quilt=dpmIan Jackson2016-09-26
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Fix spelling of "pseudo"Ian Jackson2016-09-26
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Turn gc.auto off in our hidden working tree setupsIan Jackson2016-09-26
| | | | | | | | | This avoids potential accidents: git gc --auto might otherwise run and do very undesirable things to the user's working tree. (I haven't been able to trigger such a situation deliberately and none has been reported, luckily...) Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split brain: Make pseudomergeIan Jackson2016-09-25
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split brain: Always push the maintainer view tagIan Jackson2016-09-25
| | | | | | | | | | | Our algorithm for calculating whether to do a pseudomerge to make the dgit view fast forward from the archive contents depends on the maintainer view tag (effectively, it uses it to go back from the archive contents dgit view back to the corresponding maintainer view). So we need to push it too. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split brain: Add some debug relating to tagwantsIan Jackson2016-09-25
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Changelog handling: Replace a call to parsechangelog with commit_getclogpIan Jackson2016-09-25
| | | | | | | | This is less code, and takes advantage of the memoisation. No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Changelog handling: No not check out last push any more during raw importIan Jackson2016-09-25
| | | | | | | | | | | 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>
* Changelog handling: Use mergeinfo_getclogp during raw importIan Jackson2016-09-25
| | | | | | No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Changelog handling: Provide commit_getclogp (nfc)Ian Jackson2016-09-25
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Push reorg: Have FF check use dgit view, not HEADIan Jackson2016-09-25
| | | | | | | | 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>
* del_lrfetchrefs: Improve debug output a bitIan Jackson2016-09-25
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Push reorg: Postpone FF checkIan Jackson2016-09-25
| | | | | | | 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>
* Push reorg: Introduce $archive_hash in dopush (nfc)Ian Jackson2016-09-18
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* fetch_from_archive: Mention that git_fetch_us must be called firstIan Jackson2016-09-18
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: changedir: use confess, to get a stack traceIan Jackson2016-09-18
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* fetch_from_archive: Return the hash (and update the comment)Ian Jackson2016-09-18
| | | | | | | | | | 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>
* dgit: Add a couple of commentsIan Jackson2016-09-18
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Push reorg: Move ff check out of cmd_push into dpush (nfc)Ian Jackson2016-09-18
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: With sbuild, unapply patches in right dirIan Jackson2016-09-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: With gbp-build, provide gbp with patches-unapplied treeIan Jackson2016-09-11
| | | | | | | 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>
* dgit: Make maybe_unapply_patches_again reset $patches_applied_dirtilyIan Jackson2016-09-11
| | | | | | That makes it idempotent. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split brain: Push correct view to dgit repos serverIan Jackson2016-09-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: lrfetchrefs: Delete unneeded fetched refs, etc.Ian Jackson2016-09-11
| | | | | | | | 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>
* dgit: Implement `git-fetch --no-insane'Ian Jackson2016-09-11
| | | | | | | | | | 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>
* dgit: Add a comment explaining import discardIan Jackson2016-09-06
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Clarify some messages about archive/local skewIan Jackson2016-09-06
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: New fetch algorithm - try to tolerate in-archive copiesIan Jackson2016-09-06
| | | | | | | | | | | | | | | | 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>
* Split brain: TODOsIan Jackson2016-09-05
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split tags: Push the maintainer view tag, where supportedIan Jackson2016-09-05
| | | | | | | | | | | | | | | | | 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>
* Split tags: Genrate maintainer-view tag tooIan Jackson2016-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Split tags: Preparation: Rename tag variables etc. in dopushIan Jackson2016-09-05
| | | | | | | | | | | | | | 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>
* Split tags: Preparation: Reorganise tagwants and mktagsIan Jackson2016-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Split tags: Preparation: Break out (and fix) need_tagformatIan Jackson2016-09-05
| | | | | | | | | | 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>
* Split tags: Preparation: Break out access_cfg_tagformatsIan Jackson2016-09-05
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split tags: Preparation: move select_tagformat into a new sectionIan Jackson2016-09-05
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split tags: Introduce $mktag in push_mktagIan Jackson2016-09-05
| | | | | | | | | | | | | | 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>
* Tag change: Double check agreement in rpush protocolIan Jackson2016-08-14
| | | | | | | 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>
* Tag change: Rename $tagformat to $tagformat_wantIan Jackson2016-08-14
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Use GIT_COMMITTER_DATE for automatic patchIan Jackson2016-08-14
| | | | | When automatically generating quilt patch, honour GIT_COMMITTER_DATE for filename creation (makes filename deterministic in test suite).
* Tag change: Calculate desired tag formatIan Jackson2016-07-31
| | | | | | | | | | | | 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>
* Tag change: dgit: Fetch both old ane new format tagsIan Jackson2016-07-31
| | | | | | We are going to want to know about all of these. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Tag change: Rename debiantag to debiantag_oldIan Jackson2016-07-31
| | | | | | | | | | | | | | | | | 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>
* dgit: rpush protocol comment: Add some missing protocol elementsIan Jackson2016-07-31
| | | | | | | progress, supplementary-message, previously, and param csuite, were all missing. Document them. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Split brain: When pushing, find the dgit view in the cacheIan Jackson2016-07-17
| | | | | 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.
* Innards: Improve mktree_in_ud_from_only_subdir messageIan Jackson2016-07-17
| | | | When it finds multiple subdirs, print them.
* Subprocess error handling: Initialise $? to -1Ian Jackson2016-07-17
| | | | | | | | | | | | | | | 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.
* Subprocess error handling: Fix when divert check failsIan Jackson2016-07-17
| | | | | If the remote command failed, do not try to match the undef value against the various regexps.
* Subprocess error handling: Do not call faildcmd when open failsIan Jackson2016-07-17
| | | | | failecmd wants to look at $? too and anyway the full command is not of much interest in these cases.