devtools/{depotview,hackdoc}: tie both together

Change-Id: I0a1ca3b4fa0e0a074eccbe0f8748839b926db9c1
diff --git a/devtools/depotview/proto/depotview.proto b/devtools/depotview/proto/depotview.proto
index 2584961..b948fae 100644
--- a/devtools/depotview/proto/depotview.proto
+++ b/devtools/depotview/proto/depotview.proto
@@ -2,6 +2,18 @@
 package depotview;
 option go_package = "code.hackerspace.pl/hscloud/devtools/depotview/proto";
 
+service DepotView {
+    // Resolve a git branch/tag/ref... into a commit hash.
+    rpc Resolve(ResolveRequest) returns (ResolveResponse);
+
+    // Resolve a gerrit change number into a git commit hash.
+    rpc ResolveGerritChange(ResolveGerritChangeRequest) returns (ResolveGerritChangeResponse);
+        
+    // Minimal file access API. It kinda stinks.
+    rpc Stat(StatRequest) returns (StatResponse);
+    rpc Read(ReadRequest) returns (stream ReadResponse);
+}
+
 message ResolveRequest {
     string ref = 1;
 }
@@ -11,6 +23,15 @@
     int64 last_checked = 2;
 }
 
+message ResolveGerritChangeRequest {
+    int64 change = 1;
+}
+
+message ResolveGerritChangeResponse {
+    string hash = 1;
+    int64 last_checked = 2;
+}
+
 message StatRequest {
     string hash = 1;
     string path = 2;
@@ -35,12 +56,3 @@
     // Chunk of data. Empty once everything has been sent over.
     bytes data = 1;
 }
-
-service DepotView {
-    // Resolve a git branch/tag/ref... into a commit hash.
-    rpc Resolve(ResolveRequest) returns (ResolveResponse);
-        
-    // Minimal file access API. It kinda stinks.
-    rpc Stat(StatRequest) returns (StatResponse);
-    rpc Read(ReadRequest) returns (stream ReadResponse);
-}