summaryrefslogtreecommitdiff
path: root/git-debrebase
Commit message (Collapse)AuthorAge
* git-debrebase: convert-from-*: snag on discarding comments in seriesIan Jackson2018-08-24
| | | | | | | | | series files can contain #-comments. The conversion process will throw them away, so complain about that. Closes: #907198. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: classify: Do not misclassify patches in subdirsIan Jackson2018-08-24
| | | | | | | | | The old get_differs algorithm would recurse in debian/patches. The new one failed to do that. Fix that. Closes: #907206. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: trees_diff_walk: Support recursionIan Jackson2018-08-24
| | | | | | No-one specifies this yet, so NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Fix get_tree's memoisation wrt $recurseIan Jackson2018-08-24
| | | | | | | | | | | | | | $recurse needs to be part of the key to the memo hash! Luckily, there is only one caller which calls with $recurse==1, check_series_has_all_patches. It ends up mishandles this situation by complaining about the directory names, as if they were unused patches. And after that no-one needs to call get_tree. Closes: #907202. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: trees_diff_walk: Refactor $all to \%optsIan Jackson2018-08-24
| | | | | | No callers pass this so NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide hints for unprocessable commitsIan Jackson2018-08-20
| | | | | | | | | | Depending on the apparent branch ffq state. Closes:#905005. In particular, if it doesn't look like this branch was ever used with gdr, suggest that the user is on the wrong branch, or needs to use convert-from-*. Closes:#905279. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Introduce new `fail_unprocessable'Ian Jackson2018-08-20
| | | | | | | | | This is called when we want to call `fail' because we have found an unprocessable commit. NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-*: leave debrebase-last refsIan Jackson2018-08-19
| | | | | | | To hint to everyone that this is now a gdr branch. This will make dgit push use gdr make-patches, for example. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: begin_convert_from: Break out $gdrlast_objIan Jackson2018-08-19
| | | | | | NFC Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Snag on repeated conversionsIan Jackson2018-08-19
| | | | | | | | | If debrebase-last says we are ahead of some previous gdr work, it is carrying on is unlikely to be helpful. It would only be sensible if the package is vacillating between branch formats, and this is reflected and visible in the branch history. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Refuse to start conversion if ffq-prev existsIan Jackson2018-08-19
| | | | | | | Trying to rerun git-debrebase convert-from-something, on an unstitched gdr branch, would end in tears. Forbid it utterly. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: record_gdrlast: Honour $oldvalueIan Jackson2018-08-19
| | | | | | NFC for existing callers. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Move ffq_prev_branchinfo up the fileIan Jackson2018-08-19
| | | | | | NFC Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out begin_convert_from & complete_...Ian Jackson2018-08-19
| | | | | | | | $gdrlastinfo is undef for now, and will be used in a moment. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Break out record_gdrlastIan Jackson2018-08-19
| | | | | | NFC Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: get_tree: Check we got an object nameIan Jackson2018-08-19
| | | | | | Otherwise the cache is dangerous. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Merge: Make a todo about gbp not round trippingIan Jackson2018-08-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Merges: Enable with command-line option instead of env varIan Jackson2018-08-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: New walk mechanism: Drop obsolete $opt_carefulIan Jackson2018-08-19
| | | | | | NFC Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Merge: Put off some xxx's, making them MERGE-TODOIan Jackson2018-08-19
| | | | | | | We are going to release with this machinery in this experimental state. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Document merged-breakwater metadata tagIan Jackson2018-08-19
| | | | | | | This is generated only by the experimental merge machinery and is subject to possible future change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Merge: Remove some xxx'sIan Jackson2018-08-19
| | | | | | | | | | git-debrebase(5) already has ILLEGAL OPERATIONS (which forbids many git-rebase operations) and also of course LEGAL OPERATIONS. The limitations on what kind of merges we can resolve and how will be documented when we document the merge machinery properly. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-gbp: Check separately for $dtagIan Jackson2018-08-19
| | | | | | | This allows us to print a more sensible error message, Previously git would print a fatal error, after which we carry on. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-gbp: Add a missing newline to a dieIan Jackson2018-08-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-gbp: handle missing maintainer tagIan Jackson2018-08-19
| | | | | | | | Look for / in $mtag, not in $mtag_pat. Obviously it will be in the latter. The result, before, is that we would look for a completely bogus $dtag and print daft error messages. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-gbp; on stitch failure, clarify messageIan Jackson2018-08-19
| | | | | | | | | Clarify what the preceding failure messages mean, and what the consequences are. This is part of #906641. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-gbp: Print a success message.Ian Jackson2018-08-19
| | | | | | This is part of #906641. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: convert-from-*: Snag on unused patchesIan Jackson2018-08-19
| | | | | | | | | | | Patches in d/patches which are not in series will be deleted, and not represented in the output. So call them a snag. Closes:#904997. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: get_tree: Support $precheck and $recurseIan Jackson2018-08-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: On rebase, always save ffq-prevIan Jackson2018-08-19
| | | | | | | | Even if we were both stitched and laundered. Closes:#905975. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: `prepush' is now a silent no-op if unstitched.Ian Jackson2018-08-19
| | | | | | This is more friendly. Update the docs accordingly. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Rewrite get_differs in terms of trees_diff_walkIan Jackson2018-08-19
| | | | | | | | | | | As noted, git-diff-tree is quite slow. We can do much better, by stepping across the two trees ourselves. There should be no particularly significant change: the answers should be the same for reasonable inputs. Unreasonable inputs (particularly, executable files etc.) may be handled better, even. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: get_tree: Support '' for nonexistent objectsIan Jackson2018-08-19
| | | | | | This is going to be convenient in a moment. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: New get_tree machinery: Fix debuggingIan Jackson2018-08-19
| | | | | | | | | When we localise, we get a new variable, rather than localising the binding imported from Debian::Dgit. How annoying. Also, add two new debug prints at level 3. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Fix comment documenting D_DEB_*Ian Jackson2018-08-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Actually avoid read-tree in walk when not rewritingIan Jackson2018-08-19
| | | | | | | | | | | | | | | | | | | | See git-debrebase: Prep for avoid read-tree in walk when not rewriting for the motivation. Here we try to check that the commit we would make, if we were actually calling read-tree, write-tree and hash-object, would be identical to the one we are reusing. In particular, we check that the upstream files, and the debian/ directory, have the contents we would feed to read-tree. And we check that the parent list is the same. With these checks this new algorithm is, I think, safe enough to just use always. So set $opt_careful to 0. We will abolish this variable in a moment. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Provide new get_tree and trees_diff_walkIan Jackson2018-08-19
| | | | | | | | | | | | | | These are ways to avoid calling git-diff-tree, which is very slow even with --name-only --no-renames and without recursion. I think it is doing all the work to make nice actual diffs, and then throwing them away. Two calls to git-ls-tree is about 20x faster than git-diff-tree on the Linux kernel, for example. No functional change in this commit, since no callers yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Rename $want_tree_ to $want_Ian Jackson2018-08-19
| | | | | | NFC Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Prep for avoid read-tree in walk when not rewritingIan Jackson2018-08-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the git index is a flat list of files, not a directory hierarchy, git-read-tree can be very slow. We want to avoid it if possible. Introduce a new way of working, where we defer calls to read-tree. In detail: * $read_tree_upstream and $read_tree_debian, which are the only ways that walk invokes read-tree, simply record their argument; * The actual read-tree is done just before the write-tree and commit generation. read_tree_upstream, conveniently, does both halves, if it gets both arguments. * Put all of the read-tree and commit regeneration in a branch triggered if we are rewriting or "trying to be careful". Right now we are always careful, but I have tested this with a hack setting $opt_careful to 0, and the performance on the example branch in #905995 is much improved: 3.4s rather than 77s for `git-debrebase'. This is not suitable for enabling in its current form. I want to actuallly abolish the $opt_careful, and, instead, check with get_differs or git-cat-file that the tree segments, and the parent lists, are identical. When we do that we won't be checking any more that the commit generation can generate identical commits when not rewriting. But it doesn't really matter much any more provided the commits are well-formed and right, and the test suite will check that. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: walk: Introduce $read_tree_debianIan Jackson2018-08-12
| | | | | | We are going to make these do something more efficient, sometimes. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: walk: Move $read_tree_upstream into the loopIan Jackson2018-08-12
| | | | | | NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: Drop a redundant call to $read_tree_upstreamIan Jackson2018-08-12
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: conflict: Some xxx's now doneIan Jackson2018-08-12
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Actually use merge resolutionsIan Jackson2018-08-12
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Actually record merge resolutionsIan Jackson2018-08-12
| | | | | | | | And, destroy it on scrap. Nothing consumes this yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: scrap works properly when it does only rebase --abortIan Jackson2018-08-12
| | | | | | | We use @deferred_updates to see if we actually did anything for --noop-ok purposes. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Change wreckage to refs/debrebase/wreckage/*Ian Jackson2018-08-12
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: New record-resolved-merge subcommand, WIPIan Jackson2018-08-12
| | | | | | | Right now this seems to be able to generate some commit, but it doesn't know how to record it. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Split off merge_series_patchqueue_convertIan Jackson2018-08-11
| | | | | | | | We're about to reuse this. NFC. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* git-debrebase: merge: Record the new-base in the wreckage.Ian Jackson2018-08-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>