summaryrefslogtreecommitdiff
path: root/git-debrebase
Commit message (Collapse)AuthorAge
...
* git-debrebase: merge: Improve some xxx commentsIan Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Do not sometimes drop the first patch!Ian Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Set $debugcmd_when_debuglevel = 2Ian Jackson2018-08-11
| | | | | | | | | | | This produces much better (less noisy) debug output. git-debrebase calls subcommands an awful lot and they are generally very uninteresting. If this now turns out to be insufficient, we will add additional calls to printdebug. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Reverse argumennts to check diff error messageIan Jackson2018-08-11
| | | | | | | | | | "Old, new" is more conventional. This makes debug output and error messages a bit easier to understand. We must keep the backward order for get_differs because we need to detect patch deletion, which shows up (reversed) as D_PAT_ADD. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Add a lot of printdebugIan Jackson2018-08-11
| | | | | | | | | | | | We also operated on sorted patch lists, and reorganise the prereq computation slightly, to make this possible. This `print DEBUG ... if' is not very nice. This is needed because printdebug unconditionally prints $debugprefix. These new debug prints are nearly the first which want to do multi-stage printing outside dgit (and dgit normally operates without $debugprefix set). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Detect octopi laterIan Jackson2018-08-11
| | | | | | | | | If git-debrebase or dgit were to make an octopus merge, we should recognise that as an unknown kind of gdr/dgit merge, not as a general octopus merge. This code motion leaves a spot where such a new kind of merge could be classified. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Add an xxxIan Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: New merge handing, experimental and preliminaryIan Jackson2018-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Classification: * Classify octopus merges as unknown, separately * Classify 2-parent general merges as VanillaMerge, if feature enabled * Introduce new merged-breakwater commit tag, classify as MergedBreakwaters * Classify other gdr-generated 2-parent merges as unknown Inspection (keycommits): * VanillaMerge commits require laundry, much like dgit imports, and prevent discernment of the actual breakwater and anchor Laundry (walk): * Rewrite VanillaMerge using new merge_series function Test suite: * We get a slightly different error message in gdr-unprocessable, now. Later, when we make this non-experimental all the time, we are going to have to soup up gdr-unprocessable to make a worse test commit. There are a lot of known bugs and infelicites, marked with "xxx". There is a test (which will appear in a moment) but it's rather a poor test, so there will be many uknown bugs. So all of this is enabled only if GIT_DEBREBASE_EXPERIMENTAL_MERGE is set in the environment. (Strictly, only the classification is gated, but that is sufficient.) No significant functional change without this setting. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: read_tree_upstream: New option $keep_patchesIan Jackson2018-08-11
| | | | | | NFC with existing callers. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Improve ffq head recording messageIan Jackson2018-08-10
| | | | | | | | Say `recorded _previous_ head' rather than `current head'. Since by the time the message appears, it's the previous head. In particular, `current' is very confusing if there were previous progress messages. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Make read_tree_upstream global (nfc)Ian Jackson2018-08-10
| | | | | | Save debian/ explicitly. This is a bit annoying. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Make read_tree_debian global (nfc)Ian Jackson2018-08-10
| | | | | | | We can't easily do this to read_tree_upstream because that needs to put debian/ back which is awkward. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out gbp_pq_export (nfc)Ian Jackson2018-08-10
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: walk: Introduce $report_lprefix (nfc)Ian Jackson2018-08-10
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: scrap: Run git-rebase --abort if applicableIan Jackson2018-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: check for git-rebase in progress and abort most operationsIan Jackson2018-08-04
| | | | | | scrap should abort, but doesn't yet. status just prints a message. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: scrap: Make it honour --noop-okIan Jackson2018-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: New feature `scrap'Ian Jackson2018-08-04
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide new convert-from-dgit-view operation.Ian Jackson2018-08-04
| | | | | | | | The output is, unavoidably, not very pretty. Closes:#905322. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Support --dgit option for finding dgitIan Jackson2018-08-04
| | | | | | Nothing uses this yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Improve error message formatting from $bomb in walkIan Jackson2018-08-04
| | | | | | The : and ; were messed up. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Properly reject bare dgit dsc importsIan Jackson2018-08-04
| | | | | | | | | | | A bare dgit dsc import is not a legal gdr branch, because the main merge contains debian/patches/. So it cannot be processed without conversion. Previously an attempt to launder such a branch would crash with a stack trace, although keycommits would falsely claim it was OK Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Have resolve_upstream_commit set @$tried firstIan Jackson2018-08-04
| | | | | | | This allows a caller to know what tag name was successfully found, by looking at $tried[-1]; Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out resolve_upstream_versionIan Jackson2018-08-04
| | | | | | NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: resolve_upstream_version: Rename $upstream_versionIan Jackson2018-08-04
| | | | | | | | | This used to be called $new_upstream_version but this function is called in other contexts too. NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase; Refactor resolve_upstream_version to take upstream versionIan Jackson2018-08-03
| | | | | | NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Use upstreamversion rather than open-codingIan Jackson2018-08-03
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: factor out getoptions for subcommandIan Jackson2018-08-03
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Implement --help, providing a summary.Ian Jackson2018-07-31
| | | | | | | | | | | | Provide a usage message. I'm not convinced an option summary here is a good idea, mainly there aren't any really important options. (-f will be advertised when it is relevant.) So I have just summarised the most important operations. Closes:#904990. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Improve error message for convert-from-gbp upstream discrepancyIan Jackson2018-07-31
| | | | | | | | | | | | | | | | Closes:#905078. I don't intend to print `small' diffs because I think that kind of dwim is probably more annoying than helpful. I don't intend to factor this kind of pattern out throughout because: The messages for these commands are generally not the actual diff rune dgit or gdr ran, for various reasons (notably that dgit/gdr often use object hashes). The result is that there is little duplication. So I think the situation now is OK. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Improve error messages for bad options.Ian Jackson2018-07-31
| | | | | | | | | | * GetOptions calls warn(). So we need a wrapper which disables or $SIG{__WARN__} (which prints a stack trace). * Put the call to badusage in the wrapper. * Change the messages to be clearer about what is meant. * Add the program name to the badusage message. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-gbp: Use same algorithm for finding upstreamIan Jackson2018-07-31
| | | | | | | | | | | | The version is in the changelog, and thus upstream commitish can then be found from as new-upstream. This also means we now give the same error message, which is much better than the one we had before. Closes:#905062. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out resolve_upstream_version (nfc)Ian Jackson2018-07-31
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: new-upstream: Fix handling of epochs.Ian Jackson2018-07-31
| | | | | | | | Dpkg::Version->version() is only the middle part. ->epoch() doesn't have the colon. This is inconvenient enough that we convert it to a string and use a regexp :-/. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: new-upstream: Fix error message for new version with bad syntaxIan Jackson2018-07-31
| | | | | | | | | | | Calling new Dpkg::Version , check => 1 does not die or anything if it's wrong; it just returns undef. The result is an error message about calling is_valid on an undefined value. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Pass correct argument to failIan Jackson2018-07-31
| | | | | | | | | We got the array index wrong and would print HASH(0x55be4dba1f88) or whatever. Closes:#905003. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: walk: unprocessable: use fail, not die, and clean upIan Jackson2018-07-31
| | | | | | | | | | Make this message like the one printed by $x->($fatal, ...) in keycommits. That is more consistent and also nicer. There is no need for the line number etc. either. This is mentioned in #905003. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* 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>