chiark / gitweb /
dgit.git
14 months agogit-debrebase: merge: Avoid asking user to re-merge debian/
Ian Jackson [Sat, 11 Aug 2018 12:47:59 +0000 (13:47 +0100)]
git-debrebase: merge: Avoid asking user to re-merge debian/

If it had conflicts, they will have been resolved earlier and we can
just take that resolution.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: test suite: Do a bit more testing
Ian Jackson [Sat, 11 Aug 2018 12:32:28 +0000 (13:32 +0100)]
git-debrebase: merge: test suite: Do a bit more testing

We can now call t-gdr-good laundered, because it works.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: lib-gdr: t-gdr-good: Handle MergedBreakwaters
Ian Jackson [Sat, 11 Aug 2018 12:31:58 +0000 (13:31 +0100)]
test suite: lib-gdr: t-gdr-good: Handle MergedBreakwaters

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Add another xxx comment
Ian Jackson [Sat, 11 Aug 2018 12:31:16 +0000 (13:31 +0100)]
git-debrebase: merge: Add another xxx comment

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: walk: Reintroduce the local $read_tree_upstream sub
Ian Jackson [Sat, 11 Aug 2018 13:57:47 +0000 (14:57 +0100)]
git-debrebase: walk: Reintroduce the local $read_tree_upstream sub

Now that we have the $tree_with_debian parameter to the global
read_tree_upstream, we can use it to avoid the git-write-tree call
and pass $build as the $tree_with_debian.

This thus partially reverts
  dfc092e0ec3d932e51a071000519477d0e33525c
  git-debrebase: Make read_tree_upstream global (nfc)

The combined effect is now that $read_tree_upstream does exactly the
git commands it did before.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Get debian/ parts of new patch queue right
Ian Jackson [Sat, 11 Aug 2018 12:25:41 +0000 (13:25 +0100)]
git-debrebase: merge: Get debian/ parts of new patch queue right

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>
14 months agogit-debrebase: read_tree_upstream: New $tree_with_debian parameter
Ian Jackson [Sat, 11 Aug 2018 12:20:03 +0000 (13:20 +0100)]
git-debrebase: read_tree_upstream: New $tree_with_debian parameter

If not passed, this function does the same as it did before.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Generate some more debugging commits
Ian Jackson [Sat, 11 Aug 2018 11:46:36 +0000 (12:46 +0100)]
git-debrebase: merge: Generate some more debugging commits

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: keycommits: Handle merged-breakwater commits
Ian Jackson [Sat, 11 Aug 2018 11:25:20 +0000 (12:25 +0100)]
git-debrebase: keycommits: Handle merged-breakwater commits

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: keycommits: New $claimed_bw optional argument
Ian Jackson [Sat, 11 Aug 2018 11:24:51 +0000 (12:24 +0100)]
git-debrebase: keycommits: New $claimed_bw optional argument

No users yet, so NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Generate merged-breakwaters with correct metadata
Ian Jackson [Sat, 11 Aug 2018 11:23:35 +0000 (12:23 +0100)]
git-debrebase: merge: Generate merged-breakwaters with correct metadata

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: keycommits: Break out $found_anchor
Ian Jackson [Sat, 11 Aug 2018 11:22:54 +0000 (12:22 +0100)]
git-debrebase: keycommits: Break out $found_anchor

We are going to want to reuse this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: lib-gdr: t-gdr-good: Introduce t-gdr-analyse
Ian Jackson [Sat, 11 Aug 2018 11:04:37 +0000 (12:04 +0100)]
test suite: lib-gdr: t-gdr-good: Introduce t-gdr-analyse

NFC

This will allow us to recurse.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: lib-gdr: t-gdr-good: Introduce $anal
Ian Jackson [Sat, 11 Aug 2018 11:00:24 +0000 (12:00 +0100)]
test suite: lib-gdr: t-gdr-good: Introduce $anal

NFC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Check that merge resolution is correct
Ian Jackson [Sat, 11 Aug 2018 10:51:04 +0000 (11:51 +0100)]
git-debrebase: merge: Check that merge resolution is correct

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Comment about laundry of merge of unstitched
Ian Jackson [Sat, 11 Aug 2018 10:43:40 +0000 (11:43 +0100)]
git-debrebase: merge: Comment about laundry of merge of unstitched

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>
14 months agogit-debrebase: merge: Improve some xxx comments
Ian Jackson [Sat, 11 Aug 2018 10:42:53 +0000 (11:42 +0100)]
git-debrebase: merge: Improve some xxx comments

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: test suite: Test both with and without `after'
Ian Jackson [Sat, 11 Aug 2018 10:32:51 +0000 (11:32 +0100)]
git-debrebase: merge: test suite: Test both with and without `after'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Do not sometimes drop the first patch!
Ian Jackson [Sat, 11 Aug 2018 10:32:10 +0000 (11:32 +0100)]
git-debrebase: merge: Do not sometimes drop the first patch!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Set $debugcmd_when_debuglevel = 2
Ian Jackson [Sat, 11 Aug 2018 09:58:16 +0000 (10:58 +0100)]
git-debrebase: Set $debugcmd_when_debuglevel = 2

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>
14 months agoDgit.pm: printdebug: Selectively print $debugprefix, and add a doc
Ian Jackson [Sat, 11 Aug 2018 09:52:58 +0000 (10:52 +0100)]
Dgit.pm: printdebug: Selectively print $debugprefix, and add a doc

Remember whether the last printdebug ended in a \n.  If it didn't,
suppress printing the next newline.

I don't think anywhere calls printdebug without @_ right now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: printdebug: Strip empty strings from @_ and maybe quit early
Ian Jackson [Sat, 11 Aug 2018 09:51:14 +0000 (10:51 +0100)]
Dgit.pm: printdebug: Strip empty strings from @_ and maybe quit early

Now the meat of the function always has nonempty $_[-1].

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: printdebug: Break apart the print
Ian Jackson [Sat, 11 Aug 2018 09:49:26 +0000 (10:49 +0100)]
Dgit.pm: printdebug: Break apart the print

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: printdebug: Refactor slightly
Ian Jackson [Sat, 11 Aug 2018 09:43:25 +0000 (10:43 +0100)]
Dgit.pm: printdebug: Refactor slightly

This will make the next commits easier.  NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Reverse argumennts to check diff error message
Ian Jackson [Sat, 11 Aug 2018 09:41:43 +0000 (10:41 +0100)]
git-debrebase: Reverse argumennts to check diff error message

"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>
14 months agogit-debrebase: Add a lot of printdebug
Ian Jackson [Sat, 11 Aug 2018 09:38:06 +0000 (10:38 +0100)]
git-debrebase: Add a lot of printdebug

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>
14 months agoDgit.pm: Introduce $debugcmd_when_debuglevel
Ian Jackson [Sat, 11 Aug 2018 09:26:48 +0000 (10:26 +0100)]
Dgit.pm: Introduce $debugcmd_when_debuglevel

This is also intended to be usefully localisable, and works by
localising $printdebug_when_debuglevel.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: Introduce $printdebug_when_debuglevel
Ian Jackson [Sat, 11 Aug 2018 09:26:12 +0000 (10:26 +0100)]
Dgit.pm: Introduce $printdebug_when_debuglevel

This is intended to be usefully localisable.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: merge: Detect octopi later
Ian Jackson [Sat, 11 Aug 2018 08:59:31 +0000 (09:59 +0100)]
git-debrebase: merge: Detect octopi later

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>
14 months agogit-debrebase: merge: Add an xxx
Ian Jackson [Sat, 11 Aug 2018 08:58:57 +0000 (09:58 +0100)]
git-debrebase: merge: Add an xxx

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: test suite: New gdr-merge test
Ian Jackson [Sat, 11 Aug 2018 08:58:05 +0000 (09:58 +0100)]
git-debrebase: test suite: New gdr-merge test

This still has a lot of xxx's, but as it is right now it passes,
despite all the bugs.  This seems like a reasonable baseline for more
work.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: New merge handing, experimental and preliminary
Ian Jackson [Sat, 11 Aug 2018 08:50:04 +0000 (09:50 +0100)]
git-debrebase: New merge handing, experimental and preliminary

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>
14 months agogit-debrebase: read_tree_upstream: New option $keep_patches
Ian Jackson [Fri, 10 Aug 2018 14:25:31 +0000 (15:25 +0100)]
git-debrebase: read_tree_upstream: New option $keep_patches

NFC with existing callers.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Improve ffq head recording message
Ian Jackson [Fri, 10 Aug 2018 14:26:09 +0000 (15:26 +0100)]
git-debrebase: Improve ffq head recording message

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>
14 months agotest suite: gitattributes: Change a comment from xxx to todo
Ian Jackson [Fri, 10 Aug 2018 13:56:29 +0000 (14:56 +0100)]
test suite: gitattributes: Change a comment from xxx to todo

This is not so critical.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Fix a spelling error `$merginputs' to `$mergeinputs'
Ian Jackson [Fri, 10 Aug 2018 13:50:05 +0000 (14:50 +0100)]
dgit: Fix a spelling error `$merginputs' to `$mergeinputs'

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Drop an obsolete xxx comment
Ian Jackson [Fri, 10 Aug 2018 13:46:03 +0000 (14:46 +0100)]
dgit: Drop an obsolete xxx comment

This comment comes originally from a WIP commit
  e0ebbc5879c01d4c3e802101e146c5fb08bc9d49
I have in before-rebase.2016-11-07.  In that commit, @merginputs
did not exist.  Now it does, and that is how the ref comes out.
So this comment is obsolete.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Make read_tree_upstream global (nfc)
Ian Jackson [Fri, 10 Aug 2018 13:28:50 +0000 (14:28 +0100)]
git-debrebase: Make read_tree_upstream global (nfc)

Save debian/ explicitly.  This is a bit annoying.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Make read_tree_debian global (nfc)
Ian Jackson [Fri, 10 Aug 2018 11:54:49 +0000 (12:54 +0100)]
git-debrebase: Make read_tree_debian global (nfc)

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>
14 months agotest suite: lib-gdr: Break out t-gdr-prep-new-upstream
Ian Jackson [Fri, 10 Aug 2018 06:45:22 +0000 (07:45 +0100)]
test suite: lib-gdr: Break out t-gdr-prep-new-upstream

This does not include `git tag' for the upstream, because
gdr-newupstream wants to test the case where the tag is missing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: t-some-changes: Allow control of which files are edited
Ian Jackson [Fri, 10 Aug 2018 06:44:08 +0000 (07:44 +0100)]
test suite: t-some-changes: Allow control of which files are edited

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Break out gbp_pq_export (nfc)
Ian Jackson [Fri, 10 Aug 2018 11:33:10 +0000 (12:33 +0100)]
git-debrebase: Break out gbp_pq_export (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: walk: Introduce $report_lprefix (nfc)
Ian Jackson [Fri, 10 Aug 2018 08:59:09 +0000 (09:59 +0100)]
git-debrebase: walk: Introduce $report_lprefix (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: Start 6.7
Ian Jackson [Sun, 5 Aug 2018 09:44:22 +0000 (10:44 +0100)]
changelog: Start 6.7

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: finalise 6.6. archive/debian/6.6 debian/6.6
Ian Jackson [Sun, 5 Aug 2018 09:42:15 +0000 (10:42 +0100)]
changelog: finalise 6.6.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: Fix gdr's calls to dgit when run formally in autopkgtest.
Ian Jackson [Sun, 5 Aug 2018 09:32:08 +0000 (10:32 +0100)]
test suite: Fix gdr's calls to dgit when run formally in autopkgtest.

We should not pass `--dgit='.  That causes gdr to try to exec "".

Affects gdr-import-dgitview.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: Start 6.5
Ian Jackson [Sun, 5 Aug 2018 09:19:11 +0000 (10:19 +0100)]
changelog: Start 6.5

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: finalise 6.5 archive/debian/6.5 debian/6.5
Ian Jackson [Sat, 4 Aug 2018 16:54:07 +0000 (17:54 +0100)]
changelog: finalise 6.5

14 months agochangelog: Categorise and reorder entries
Ian Jackson [Sat, 4 Aug 2018 16:38:35 +0000 (17:38 +0100)]
changelog: Categorise and reorder entries

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: scrap: Run git-rebase --abort if applicable
Ian Jackson [Sat, 4 Aug 2018 13:31:41 +0000 (14:31 +0100)]
git-debrebase: scrap: Run git-rebase --abort if applicable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: check for git-rebase in progress and abort most operations
Ian Jackson [Sat, 4 Aug 2018 13:28:16 +0000 (14:28 +0100)]
git-debrebase: check for git-rebase in progress and abort most operations

scrap should abort, but doesn't yet.  status just prints a message.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: gdr-subcommands: Drop obsolete line
Ian Jackson [Sat, 4 Aug 2018 13:06:21 +0000 (14:06 +0100)]
test suite: gdr-subcommands: Drop obsolete line

We have done this another way and there will never be a push-hook like
this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: gdr-subcommands: Test scrap
Ian Jackson [Sat, 4 Aug 2018 13:06:03 +0000 (14:06 +0100)]
test suite: gdr-subcommands: Test scrap

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: scrap: Make it honour --noop-ok
Ian Jackson [Sat, 4 Aug 2018 13:05:43 +0000 (14:05 +0100)]
git-debrebase: scrap: Make it honour --noop-ok

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: gdr-viagit: Test scrap
Ian Jackson [Sat, 4 Aug 2018 12:41:43 +0000 (13:41 +0100)]
test suite: gdr-viagit: Test scrap

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: New feature `scrap'
Ian Jackson [Sat, 4 Aug 2018 12:40:15 +0000 (13:40 +0100)]
git-debrebase: New feature `scrap'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: gdr-import-dgitview: Actually test convert-from-dgitview
Ian Jackson [Sat, 4 Aug 2018 11:02:21 +0000 (12:02 +0100)]
test suite: gdr-import-dgitview: Actually test convert-from-dgitview

This was always my intention with this test, of course.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Provide new convert-from-dgit-view operation.
Ian Jackson [Sat, 4 Aug 2018 11:01:50 +0000 (12:01 +0100)]
git-debrebase: Provide new convert-from-dgit-view operation.

The output is, unavoidably, not very pretty.

Closes:#905322.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Support --dgit option for finding dgit
Ian Jackson [Sat, 4 Aug 2018 10:18:29 +0000 (11:18 +0100)]
git-debrebase: Support --dgit option for finding dgit

Nothing uses this yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: gdr-import-dgitview: New test for dgit dsc imports
Ian Jackson [Sat, 4 Aug 2018 09:44:59 +0000 (10:44 +0100)]
test suite: gdr-import-dgitview: New test for dgit dsc imports

So far this just tests the bugfixes I've just done.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Improve error message formatting from $bomb in walk
Ian Jackson [Sat, 4 Aug 2018 09:42:42 +0000 (10:42 +0100)]
git-debrebase: Improve error message formatting from $bomb in walk

The : and ; were messed up.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Properly reject bare dgit dsc imports
Ian Jackson [Sat, 4 Aug 2018 09:35:58 +0000 (10:35 +0100)]
git-debrebase: Properly reject bare dgit dsc imports

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>
14 months agogit-debrebase: Have resolve_upstream_commit set @$tried first
Ian Jackson [Sat, 4 Aug 2018 06:52:38 +0000 (07:52 +0100)]
git-debrebase: Have resolve_upstream_commit set @$tried first

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>
14 months agogit-debrebase: Break out resolve_upstream_version
Ian Jackson [Sat, 4 Aug 2018 06:39:11 +0000 (07:39 +0100)]
git-debrebase: Break out resolve_upstream_version

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: resolve_upstream_version: Rename $upstream_version
Ian Jackson [Sat, 4 Aug 2018 06:35:05 +0000 (07:35 +0100)]
git-debrebase: resolve_upstream_version: Rename $upstream_version

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>
14 months agogit-debrebase; Refactor resolve_upstream_version to take upstream version
Ian Jackson [Fri, 3 Aug 2018 14:36:03 +0000 (15:36 +0100)]
git-debrebase; Refactor resolve_upstream_version to take upstream version

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Use upstreamversion rather than open-coding
Ian Jackson [Fri, 3 Aug 2018 13:11:05 +0000 (14:11 +0100)]
git-debrebase: Use upstreamversion rather than open-coding

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: Move upstreamversion from dgit
Ian Jackson [Fri, 3 Aug 2018 13:10:37 +0000 (14:10 +0100)]
Dgit.pm: Move upstreamversion from dgit

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: Deconfuse argument orders of is_orig_file_of_p_v etc.
Ian Jackson [Fri, 3 Aug 2018 13:08:23 +0000 (14:08 +0100)]
Dgit.pm: Deconfuse argument orders of is_orig_file_of_p_v etc.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Improve error message for unknown suite, to suggest -d
Ian Jackson [Fri, 3 Aug 2018 13:38:37 +0000 (14:38 +0100)]
dgit: Improve error message for unknown suite, to suggest -d

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agoDgit.pm: Move is_orig_file_of_p_v and its dependencies from dgit
Ian Jackson [Fri, 3 Aug 2018 12:49:37 +0000 (13:49 +0100)]
Dgit.pm: Move is_orig_file_of_p_v and its dependencies from dgit

We want is_orig_file_of_p_v, so move it and all the things it depends
on.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: factor out getoptions for subcommand
Ian Jackson [Fri, 3 Aug 2018 11:53:10 +0000 (12:53 +0100)]
git-debrebase: factor out getoptions for subcommand

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Provide print-unapplied-treeish subcommand.
Ian Jackson [Fri, 3 Aug 2018 11:18:00 +0000 (12:18 +0100)]
dgit: Provide print-unapplied-treeish subcommand.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Break out quilt_fakedsc2unapplied.
Ian Jackson [Fri, 3 Aug 2018 10:09:21 +0000 (11:09 +0100)]
dgit: Break out quilt_fakedsc2unapplied.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Rename --dgit-view-save to --save-dgit-view, leaving an alias.
Ian Jackson [Fri, 3 Aug 2018 06:59:34 +0000 (07:59 +0100)]
dgit: Rename --dgit-view-save to --save-dgit-view, leaving an alias.

This name makes more sense.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agodgit: Refactor %internal_object_save from $dgit_view_save
Ian Jackson [Fri, 3 Aug 2018 06:55:31 +0000 (07:55 +0100)]
dgit: Refactor %internal_object_save from $dgit_view_save

Preparatory to allow saving other internal objects.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: editing a test script overrides DGIT_TESTS_PROGRESSIVE.
Ian Jackson [Fri, 3 Aug 2018 06:31:09 +0000 (07:31 +0100)]
test suite: editing a test script overrides DGIT_TESTS_PROGRESSIVE.

By making the script a dependency of the .ok stamp file.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: Add t-tstunt-parsechangelog to many gdr tests.
Ian Jackson [Fri, 3 Aug 2018 06:29:52 +0000 (07:29 +0100)]
test suite: Add t-tstunt-parsechangelog to many gdr tests.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: start 6.5
Ian Jackson [Thu, 2 Aug 2018 07:31:30 +0000 (08:31 +0100)]
changelog: start 6.5

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: finalise 6.4 archive/debian/6.4 debian/6.4
Ian Jackson [Thu, 2 Aug 2018 07:24:52 +0000 (08:24 +0100)]
changelog: finalise 6.4

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase(1): Fix typo "unappled".
Ian Jackson [Thu, 2 Aug 2018 06:39:12 +0000 (07:39 +0100)]
git-debrebase(1): Fix typo "unappled".

Closes:#905064.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: start 6.4
Ian Jackson [Thu, 2 Aug 2018 02:48:03 +0000 (03:48 +0100)]
changelog: start 6.4

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: finalise 6.3 archive/debian/6.3 debian/6.3
Ian Jackson [Thu, 2 Aug 2018 02:46:24 +0000 (03:46 +0100)]
changelog: finalise 6.3

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Implement --help, providing a summary.
Ian Jackson [Tue, 31 Jul 2018 13:05:20 +0000 (14:05 +0100)]
git-debrebase: Implement --help, providing a summary.

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>
14 months agodgit-maint-debrebase(7): Warn more against plain git rebase.
Ian Jackson [Tue, 31 Jul 2018 12:56:46 +0000 (13:56 +0100)]
dgit-maint-debrebase(7): Warn more against plain git rebase.

Specifically,
 - warn that pseudomerges must not be rebased over
 - warn and that git-rebase without a base should not be used
 - say to run gdr instead

Closes:#905004.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase(1): Warn against plain git rebase.
Ian Jackson [Tue, 31 Jul 2018 12:55:28 +0000 (13:55 +0100)]
git-debrebase(1): Warn against plain git rebase.

Re #905004.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase(5): Add ILLEGAL OPERATIONS section.
Ian Jackson [Tue, 31 Jul 2018 12:52:03 +0000 (13:52 +0100)]
git-debrebase(5): Add ILLEGAL OPERATIONS section.

Re #905004.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite; convert-from-gbp: test not identical in upstream files
Ian Jackson [Tue, 31 Jul 2018 12:40:47 +0000 (13:40 +0100)]
test suite; convert-from-gbp: test not identical in upstream files

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: Improve error message for convert-from-gbp upstream discrepancy
Ian Jackson [Tue, 31 Jul 2018 12:37:39 +0000 (13:37 +0100)]
git-debrebase: Improve error message for convert-from-gbp upstream discrepancy

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>
14 months agogit-debrebase: Improve error messages for bad options.
Ian Jackson [Tue, 31 Jul 2018 12:28:41 +0000 (13:28 +0100)]
git-debrebase: Improve error messages for bad options.

* 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>
14 months agogit-debrebase: convert-from-gbp: Use same algorithm for finding upstream
Ian Jackson [Tue, 31 Jul 2018 12:16:53 +0000 (13:16 +0100)]
git-debrebase: convert-from-gbp: Use same algorithm for finding upstream

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>
14 months agogit-debrebase: Break out resolve_upstream_version (nfc)
Ian Jackson [Tue, 31 Jul 2018 08:21:47 +0000 (09:21 +0100)]
git-debrebase: Break out resolve_upstream_version (nfc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: new-upstream: Fix handling of epochs.
Ian Jackson [Tue, 31 Jul 2018 09:21:57 +0000 (10:21 +0100)]
git-debrebase: new-upstream: Fix handling of epochs.

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>
14 months agotest suite: gdr-unprocessable: new test
Ian Jackson [Tue, 31 Jul 2018 08:13:55 +0000 (09:13 +0100)]
test suite: gdr-unprocessable: new test

Test git-debrebase messages about unprocessable commits.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agotest suite: gdr-convert-gbp: Provide some unprocessable branches
Ian Jackson [Tue, 31 Jul 2018 08:12:52 +0000 (09:12 +0100)]
test suite: gdr-convert-gbp: Provide some unprocessable branches

We'll add a test which uses these, in a moment.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agogit-debrebase: new-upstream: Fix error message for new version with bad syntax
Ian Jackson [Tue, 31 Jul 2018 08:09:35 +0000 (09:09 +0100)]
git-debrebase: new-upstream: Fix error message for new version with bad syntax

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>
14 months agogit-debrebase: keycommits: Pass correct argument to fail
Ian Jackson [Tue, 31 Jul 2018 06:58:15 +0000 (07:58 +0100)]
git-debrebase: keycommits: Pass correct argument to fail

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>
14 months agogit-debrebase: walk: unprocessable: use fail, not die, and clean up
Ian Jackson [Tue, 31 Jul 2018 06:55:47 +0000 (07:55 +0100)]
git-debrebase: walk: unprocessable: use fail, not die, and clean up

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>
14 months agochangelog: start 6.3~
Ian Jackson [Sun, 29 Jul 2018 12:03:21 +0000 (13:03 +0100)]
changelog: start 6.3~

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 months agochangelog: finalise 6.2 archive/debian/6.2 debian/6.2
Ian Jackson [Sun, 29 Jul 2018 12:00:06 +0000 (13:00 +0100)]
changelog: finalise 6.2

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>