From: Ian Jackson Date: Fri, 24 Aug 2018 23:43:17 +0000 (+0100) Subject: git-debrebase: Make all commit annotations have a COMMIT-TYPE X-Git-Tag: archive/debian/6.10~59 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=d8d6dd2d86874c07d5238dd3112ae34ceaf41662 git-debrebase: Make all commit annotations have a COMMIT-TYPE Omitting this sometimes turns out to have a mistake. We are going to want to distinguish at least split from other commits. Add a COMMIT-TYPE to the others as future-proofing. Signed-off-by: Ian Jackson --- diff --git a/git-debrebase b/git-debrebase index c3531112..529286e6 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1201,8 +1201,8 @@ sub walk ($;$$$) { my ($prose, $info) = @_; my $ms = $cl->{Msg}; chomp $ms; - $info //= ''; - $ms .= "\n\n[git-debrebase$info: $prose]\n"; + confess unless defined $info; + $ms .= "\n\n[git-debrebase $info: $prose]\n"; return (Msg => $ms); }; my $rewrite_from_here = sub { @@ -1283,7 +1283,7 @@ sub walk ($;$$$) { } elsif ($ty eq 'Mixed') { my $queue = sub { my ($q, $wh) = @_; - my $cls = { %$cl, $xmsg->("split mixed commit: $wh part") }; + my $cls = { %$cl, $xmsg->("mixed commit: $wh part",'split') }; push @$q, $cls; }; $queue->(\@brw_cl, "debian"); @@ -1336,12 +1336,12 @@ sub walk ($;$$$) { push @brw_cl, { %$cl, SpecialMethod => 'DgitImportDebianUpdate', - $xmsg->("convert dgit import: debian changes") + $xmsg->("debian changes", 'convert dgit import') }, { %$cl, SpecialMethod => 'DgitImportUpstreamUpdate', $xmsg->("convert dgit import: upstream update", - " anchor") + "anchor") }; $prline->(" Import"); $rewrite_from_here->(\@brw_cl); @@ -1534,7 +1534,7 @@ sub walk ($;$$$) { %$cl, SpecialMethod => 'MergeCreateMergedBreakwaters', $xmsg->('constructed from vanilla merge', - ' merged-breakwater'), + 'merged-breakwater'), }; push @upp_cl, { %$cl, @@ -2198,7 +2198,7 @@ END # Now we have the final new breakwater branch in the index $new_bw = make_commit [ $new_bw ], [ "Update changelog for new upstream $new_upstream_version", - "[git-debrebase: new upstream $new_upstream_version, changelog]", + "[git-debrebase changelog: new upstream $new_upstream_version]", ]; }; @@ -2411,7 +2411,7 @@ sub make_patches ($) { read_tree_subdir 'debian/patches', $ptree; $out = make_commit [$head], [ 'Commit patch queue (exported by git-debrebase)', - '[git-debrebase: export and commit patches]', + '[git-debrebase make-patches: export and commit patches]', ]; }; return $out; @@ -2750,7 +2750,7 @@ Import effective orig tree for upstream version $version END This includes the contents of the .orig(s), minus any debian/ directory. -[git-debrebase import-from-dgit-view upstream-import-convert: $version] +[git-debrebase convert-from-dgit-view upstream-import-convert: $version] END ]; push @upstreams, { Commit => $ups_synth, @@ -2784,7 +2784,7 @@ END 'git-debrebase convert-from-dgit-view: drop upstream changes from breakwater', "Drop upstream changes, and delete debian/patches, as part of converting\n". "to git-debrebase format. Upstream changes will appear as commits.", - '[git-debrebase convert-from-dgit-view: drop patches from tree]' + '[git-debrebase convert-from-dgit-view drop-patches]' ]; } $work = make_commit [ $work, $u->{Commit} ], [ diff --git a/git-debrebase.5.pod b/git-debrebase.5.pod index f641a70f..e3ed3093 100644 --- a/git-debrebase.5.pod +++ b/git-debrebase.5.pod @@ -551,21 +551,21 @@ in the messages of commits it generates. The general form is - [git-debrebase[ COMMIT-TYPE [ ARGS...]]: PROSE, MORE PROSE] + [git-debrebase COMMIT-TYPE [ ARGS...]: PROSE, MORE PROSE] git-debrebase treats anything after the colon as a comment, paying no attention to PROSE. The full set of annotations is: - [git-debrebase: split mixed commit, debian part] - [git-debrebase: split mixed commit, upstream-part] - [git-debrebase: convert dgit import, debian changes] + [git-debrebase split: mixed commit, debian part] + [git-debrebase split: mixed commit, upstream-part] + [git-debrebase onvert dgit import: debian changes] [git-debrebase anchor: convert dgit import, upstream changes] [git-debrebase upstream-combine . PIECE[ PIECE...]: new upstream] [git-debrebase anchor: new upstream NEW-UPSTREAM-VERSION, merge] - [git-debrebase: new upstream NEW-UPSTREAM-VERSION, changelog] - [git-debrebase: export and commit patches] + [git-debrebase changelog: new upstream NEW-UPSTREAM-VERSION] + [git-debrebase make-patches: export and commit patches] [git-debrebase convert-from-gbp: drop patches] [git-debrebase anchor: declare upstream] @@ -574,6 +574,8 @@ The full set of annotations is: [git-debrebase merged-breakwater: constructed from vanilla merge] [git-debrebase convert-to-gbp: commit patches] + [git-debrebase convert-from-dgit-view upstream-import-convert: VERSION] + [git-debrebase convert-from-dgit-view drop-patches] Only anchor merges have the C<[git-debrebase anchor: ...]> tag. Single-parent anchors are not generated by git-debrebase,