summaryrefslogtreecommitdiff
path: root/git-debrebase
Commit message (Collapse)AuthorAge
* Remove // from inside conditionalsIan Jackson2018-07-29
| | | | | | | | | | | This idiom is terse, but quite confusing. Instead, handle the undef case explicitly. While we are editing these: * Change two internal errors from die to confess * Fix a die in git-debrebase which ought to be badusage Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase convert-from-gbp: Add ffq checkIan Jackson2018-07-09
| | | | | | | | | Check that the result will not count as having diverged. This will usually turn failures to make the ff pseudomerge into -fdiverged. Related to #903132. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase convert-from-gbp: Make it ff of dgit view, if we can.Ian Jackson2018-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | Look for dgit-generated tags so we can usually make the new branch ff of the dgit view. Specifically, we fish the most recent released version out of debian/changelog and look for a DISTRO/VSN tag and a corresponding archive/DISTRO/VSN tag. If this all looks good, we declare ff of archive/. This should avoid the need for dgit push --overwrite in most cases. We do not check the DISTRO name. In principle dgit could find the distro name from the suite name, but that makes the software layering quite complicated. (For example, we would have to provide a way to tell gdr what program to run for dgit, for the benefit of the test suite.) I think the current approach is good enough; there are not likely to be any tag pairs that look like the right kind of thing but are in fact something else entirely, so we're not likely to accidentally trash some wanted changes. Closes:#903132. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Set $|Ian Jackson2018-07-09
| | | | | | | | This will avoid pepeering everything with calls to flush. Without it some messages from ffq_check, say, can arrive after the stderr output from a subsequent snags_maybe_bail, which is quite confusing. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide snags_maybe_bail_earlyIan Jackson2018-07-09
| | | | | | No callers yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Replace `die badusage' with `badusage'.Ian Jackson2018-07-09
| | | | | | | | | badusage contains a call to finish. So the die is redundant and never gets called. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: ffq_check: Move defaults for $ff and $notff into subIan Jackson2018-07-09
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out ff_check (for reuse by convert-from-gbp)Ian Jackson2018-07-08
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: record_ffq_prev_deferred: Move get_head();Ian Jackson2018-07-08
| | | | | | No functional change. This will make ff check easier to split out. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Improve grammar if one blocking snag.Ian Jackson2018-07-07
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase new-upstream: Add a -1 revision if the user didn't supply one.Ian Jackson2018-07-07
| | | | | | Closes:#903127. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: status: Reorganise commit reporting.Ian Jackson2018-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | Replace the references to @_ with a hash. Using a hash is much less confusing than all this numerical indexing. Also, \@_ is wrong because there is only one @_, so by the time it is dereference, the commit being printed is the anchor. This is why in #903131 we see branch is unlaundered found mixed upstream/packaging commit (7badba627162337c7057002f37e9a1a593d07d08) abcc6260 Update to upstream 2.9.7 which appears to sugggest that the anchor is a mixed commit. Actually the mixed commit is 7badba627162 but the subsequent message is based on @_ which has different information in it by then. And, set $kcmsg from the main message, not including the commit information. We are the more sophisticated caller mentioned in the previous commmit. Closes: #903131. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Callbacks get separate $mainwhyIan Jackson2018-07-07
| | | | | | | | | | | | | | Separate out the extra contextual info, naming the hash of the commit being complained about, into a separate argument to $x->(). This allows us to pass the message without that as an additional argument to the callbacks. This way we can still pass \&snag as a callback but other callers can do something more sophisticated involving $cl. No functional change for any existing callers. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit, git-debrebase: Properly make patches with nasty .gitignores.Ian Jackson2018-07-06
| | | | | | | | | | | | | | | | | | | | | | | Specifically: * When running git status --porcelain, pass --ignored so it lists ignored files, and handle the ! output that it then produces. * Add missing -f to a few git add invocations. I have done some greps ('git.*add', 'git.*status', 'porcelain', etc.) to try to find other missed cases and none turned up. git diff is OK because normally we pass two treeish arguments, in which case the ignores are ignored by git diff. When we are asking it to look at the working tree, we are expecting it to ignore untracked files (whether ignored or not), and diff tracked ones, which is what it does. Closes:#903130. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase new-upstream: Provide better reflog entriesIan Jackson2018-06-26
| | | | | | | | By setting GIT_REFLOG_ACTION. Closes:#901925. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* ref updates: Introduce update_ref_cmdIan Jackson2018-06-26
| | | | | | | | | | | | | | | | | | Currently the comment about `message may be modified' is rather misleading, since there is no code to do that - but it explains the semantics of the new function. We change the appropriate subset of the git update-ref call sites. These are precisely the ones where we previously specified a message with -m, except for the quilt cache (where we use the reflog message as the cache lookup key). The calls are updates of internal refs etc. We end up using qw(git) rather than @git. Otherwise no functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: suppress gbp pq export outputIan Jackson2018-06-20
| | | | | | Except in case of error. Closes:#901809. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: new-upstream: fix ff check handling of multi-piece upstreamsIan Jackson2018-06-20
| | | | | | | Multi-piece combine commits may have n or n+1 parents, depending on whether the previous new-upstream invocation was snag-free. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Rename new-upstream-v0 command to new-upstreamIan Jackson2018-06-17
| | | | | | | | | | This UI is pretty good now, I think, for single-piece upstreams. For multi-piece ones, which are quite tricky anyway, it is tolerable, and we it doesn't steal much of the available syntax space. So we don't need the -v0 any more. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Split into its own packageIan Jackson2018-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | * Provide and use Debian::Dgit::GDR which does the same for @INC as Debian::Dgit:Infra, only for GDR. It's not *entirely* similar as its doc comment talks about ExitStatus too. * In Makefile, split off lots of GDR_* variables and the two targets install-gdr and installdirs-gdr We take no care that only the required manpages are built for each install target; instead, they all go in MANPAGES and `all'. * Add a control file stanza. git-debrebase takes over the dependenc on libfile-fnmatch-perl. We Recommend dgit and gbp. (Even though if you're working with neither the Debian archive nor `3.0 (quilt)', you need neither.) * In rules, add specpkg_install_gdr, to run the Makefile machinery. * In the test dependencies, GDR now means to ask for git-debrebase and also git-buildpackage (for make-patches). libfile-fnmatch-perl is handled via the dependencies of git-debrebase.deb. * Add a .gitignore for the staging area in debian/ Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: divergence checking: Do not mind if a ref we are checking ↵Ian Jackson2018-06-17
| | | | | | does not exist Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Use git-deborig style upstream commitish findingIan Jackson2018-06-17
| | | | | | | | | As discussed in email with Sean. We could use git-deborig --just-print --version= but its error handling is rather troublesome. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Add some plans for future, in a commentIan Jackson2018-06-17
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: gdr_ffq_prev_branchinfo: move from git-debrebaseIan Jackson2018-06-17
| | | | | | dgit is going to want this too, for interoperability. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: make-patched: Provide --quiet-would-amendIan Jackson2018-06-17
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Change exit status for patch amendments, to 7Ian Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: make_patches; Move get_differs into cmd_...Ian Jackson2018-06-16
| | | | | | | | | | We want to make the error handling dependent on options, etc. Moving the differs analysis into cmd_make_patches avoids having a complex calling convention for make_patches. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide status subcommandIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Now $fatal hookIan Jackson2018-06-16
| | | | | | | | | | This allows a caller to avoid having keycommits crash on unrecognisable stuff. This will be used in a moment. No functional change, because the default implementation calls fail the same way it did before. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits abolish use of last etc.Ian Jackson2018-06-16
| | | | | | | | | Previously, presumably, this little fragment was within an anonymous sub. Now it isn't any more, and we can simply return. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Pass $cl to callbacksIan Jackson2018-06-16
| | | | | | No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Move up $cl (nfc)Ian Jackson2018-06-16
| | | | | | We are going to want this within the scope of the anon sub $x. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Fix multi-orig handlingIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Fix snaggingIan Jackson2018-06-16
| | | | | | | | | | | | | | * Rename $snags_checked to $snags_summarised and make it a counter of the snags we have summarised in snags_maybe_bail. * Introduce all_snags_summarised, which uses arithmetic to see if we have had new snags since the most recent snags_maybe_bail, * Use this in run_deferred_updates rather than the existing approach; this means we can crash if there were new snags for which we should have bailed. * Make snags_maybe_bail not produce a redundant identical summary. * Initialise counters to 0 so arithmetic does not give undef warnings. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Some notes on anchor parent orderingIan Jackson2018-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the result of some playing around with gitk. Notably, for example, git-branch -f t dgit/stretch-security && ~/things/Dgit/play/swap-pseudomerges -f RELEASE-4.8.0..t where dgit/stretch-security is c9517ee45383271e90f40b7a9773d1e6fefaeca7 and swap-pseudomerges is something like this #!/bin/sh # # runs # git-filter-branch --some-filters "$@" set -e git-filter-branch --parent-filter ' case "$(git cat-file commit $GIT_COMMIT)" in *"git-debrebase new-upstream breakwater"*|*"git-debrebase anchor"*) perl -ne '\'' chomp; print join " ", reverse split / +(?=-p )/; print "\n"; '\'' ;; *) cat esac ' "$@" or .... *"git-debrebase new-upstream breakwater"*|*"git-debrebase anchor"*) .... and then runes like gitk --first-parent dgit/stretch-security & gitk dgit/stretch-security -- ':/' ':!/debian' & etc. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Commentary: explain why pseudomerges are the way round they areIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Change badusage exit status to 8Ian Jackson2018-06-16
| | | | | | This matches dgit. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* exit status: Fix git-debrebase to use Debian::Dgit::ExitStatusIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Implement make-patchesIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Run gbp pq export only from (perhaps private) laundered branchIan Jackson2018-06-16
| | | | | | | | | | When the branch is stitched, gbp pq will descend into both sides of the pseudomerge. This will duplicate patches and be generally bad. So instead, use walk to generate, privately, a laundered version of HEAD, to use to generate the patches. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out make_patches_staged (nfc)Ian Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: conclude, quick: uncleanness after laundry is fatalIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Defend against missing snags_maybe_bail callsIan Jackson2018-06-16
| | | | | | | | | Almost the only thing gdr does as an output is to update HEAD and other refs. That's done with run_deferred_updates. So, there, check that (i) we have called snags_maybe_bail at least once; (ii) we have not had any snags since. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Add a several missing snags_maybe_bail callsIan Jackson2018-06-16
| | | | | | | That these were missing is a bit alarming. I am about to add some more defences against missing this check. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Fix a message to use "" properlyIan Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Do not mind stitching an unlaundered branchIan Jackson2018-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | <Diziet> I discover that stitch treats non-launderedness as a snag. <Diziet> This is not quite compatible with these newfangled push-your-unlaundered-stuff workflows. <Diziet> It would be possible to make one of prepush or stitch (currently synonyms) behave differently in this respect. <spwhitton> do you know why stitch treats non-launderedness as a snag? <spwhitton> given that we expect [most people] to use `git debrebase conclude`, which launders, and never invoke `git debrebase stitch` explicitly, it would be okay to change that such that `git debrebase stitch` does not consider non-launderedness to be a snag. <Diziet> I think it does that just because I am the kind of person who thinks, when writing some routine, "what could I check here?" :-) <Diziet> I think you are perhaps right that it ought not to. <Diziet> "conclude" didn't exist then of course. <spwhitton> okay. git-debrebase(1) could note "you probably want conclude because you probably want to launder" <Diziet> Mmmm. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: do_stitch: Introduce $unclean argumentIan Jackson2018-06-16
| | | | | | Update all call sites. No functional change just yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide "prepush"Ian Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide and test "conclude"Ian Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Rename `conclude' to `quick'Ian Jackson2018-06-16
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>