summaryrefslogtreecommitdiff
path: root/git-debrebase
Commit message (Collapse)AuthorAge
...
* git-debrebase: merge: Get debian/ parts of new patch queue rightIan Jackson2018-08-11
| | | | | | | | | | We want the newly generated delta queue commits to have the $newbase's debian/. Previously we let read_tree_upstream save and restore debian/, but the contents of debian/ in the index are not right: they're the result of the git merge, which is whatever is left over from earlier. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: read_tree_upstream: New $tree_with_debian parameterIan Jackson2018-08-11
| | | | | | | | If not passed, this function does the same as it did before. NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Generate some more debugging commitsIan Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Handle merged-breakwater commitsIan Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: New $claimed_bw optional argumentIan Jackson2018-08-11
| | | | | | No users yet, so NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Generate merged-breakwaters with correct metadataIan Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: keycommits: Break out $found_anchorIan Jackson2018-08-11
| | | | | | We are going to want to reuse this. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Check that merge resolution is correctIan Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Comment about laundry of merge of unstitchedIan Jackson2018-08-11
| | | | | | | | I have concluded that this is not a problem avoidable by git-debrebase, and that any trouble will be tolerable (at least, not data loss). The user should try to avoid doing this. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* 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>