chiark / gitweb /
Protocol change: Add distro info to Dgit field
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Jan 2017 18:29:00 +0000 (18:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 22:14:48 +0000 (22:14 +0000)
Downstream clients may need this to get the relevant git commits.
Worse, with the new rewrite functionality, they may get the _wrong_
commits because they may not be rewritten.

For now we implement the publication side.  The reader side is
theoretically straightforward, but probably not so simple in reality,
and certainly fiddly to test.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit
dgit.7

index b72ac69e7d373464eaa6e2d820e3119bd41f5a1e..562e4152dfe3d4aac7d0c28ad30edb9947c5dd58 100644 (file)
@@ -1,4 +1,9 @@
-dgit (2.17~) unstable; urgency=medium
+dgit (3.0~) unstable; urgency=medium
+
+  Protocol change:
+  * Dgit: field now records the nominal distro name, and a hint
+    for a tag and url where the git objects (including any rewrite
+    map) can be fetched..
 
   Bugfixes:
   * dgit config handling: Honour command-line and context-provided
 
   Bugfixes:
   * dgit config handling: Honour command-line and context-provided
diff --git a/dgit b/dgit
index 0ae84b2869b4c127876ed989d223ab6a9402c757..54c38c24f534c668b3ecf6e3fccbd62d70cb5c48 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3723,7 +3723,11 @@ sub push_mktags ($$ $$ $) {
 
     die unless $tagwants->[0]{View} eq 'dgit';
 
 
     die unless $tagwants->[0]{View} eq 'dgit';
 
-    $dsc->{$ourdscfield[0]} = $tagwants->[0]{Objid};
+    my $declaredistro = access_nomdistro();
+    my $reader_giturl = do { local $access_forpush=0; access_giturl(); };
+    $dsc->{$ourdscfield[0]} = join " ",
+       $tagwants->[0]{Objid}, $declaredistro, $tagwants->[0]{Tag},
+       $reader_giturl;
     $dsc->save("$dscfn.tmp") or die $!;
 
     my $changes = parsecontrol($changesfile,$changesfilewhat);
     $dsc->save("$dscfn.tmp") or die $!;
 
     my $changes = parsecontrol($changesfile,$changesfilewhat);
@@ -3740,7 +3744,6 @@ sub push_mktags ($$ $$ $) {
     # to control the "tagger" (b) we can do remote signing
     my $authline = clogp_authline $clogp;
     my $delibs = join(" ", "",@deliberatelies);
     # to control the "tagger" (b) we can do remote signing
     my $authline = clogp_authline $clogp;
     my $delibs = join(" ", "",@deliberatelies);
-    my $declaredistro = access_nomdistro();
 
     my $mktag = sub {
        my ($tw) = @_;
 
     my $mktag = sub {
        my ($tw) = @_;
diff --git a/dgit.7 b/dgit.7
index f7e50e4b6c45ec05efbd636ba1b6a5fdfc3ba00f..584632cb24d8a3075b36d8a008cf6711fcb53ca9 100644 (file)
--- a/dgit.7
+++ b/dgit.7
@@ -56,8 +56,11 @@ server to authenticate pushes.
 Uploads made by dgit contain an additional field
 .B Dgit
 in the source package .dsc.  (This is added by dgit push.)
 Uploads made by dgit contain an additional field
 .B Dgit
 in the source package .dsc.  (This is added by dgit push.)
-This specifies a commit (an ancestor of the dgit/suite
-branch) whose tree is identical to the unpacked source upload.
+This specifies: a commit (an ancestor of the dgit/suite
+branch) whose tree is identical to the unpacked source upload;
+and the distro and suite to which the upload was made
+(and a url,
+in case the client seeing this .dsc does not know of that distro).
 
 Uploads not made by dgit are represented in git by commits which are
 synthesised by dgit.  The tree of each such commit corresponds to the
 
 Uploads not made by dgit are represented in git by commits which are
 synthesised by dgit.  The tree of each such commit corresponds to the