summaryrefslogtreecommitdiff
path: root/patch.proto.next
blob: 8958ac65367a27cdbc7140c289fe28dae465cb76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

syntax = "proto3";

package forgepb;

import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp

//    Forge doesn't need this kind of specificity
//    but this is what the patch files contain and how git sees them
// message Blob {
//         string hunkLine         = 1;
//         bytes  data             = 2;
// }
//
// message File {
//         string filename         = 1;
//         string hashLine         = 2;
// 	   repeated Blob  Blobs    = 3;
// }
//
// message Patch {
// 	repeated File  Files    = 1;
//      string repoNamespace    = 2;
// 	string   gH             = 3;
// 	string   gaI            = 4;
// 	string   gcI            = 5;
// }

// git log -1 --format="%H %aI %cI %an %ae %cn %ce"

message Patch {
        string                      namespace      = 1;  // the base repo git namespace
        bytes                       data           = 2;  // the raw data of the whole patch
        string                      gH             = 3;  // Commit Hash (%H)
        string                      gT             = 4;  // Tree Hash (%T)
        string                      gP             = 5;  // Parent Hashes (%P)
        string                      gs             = 6;  // Subject (%s)
        string                      gaI            = 7;  // Author Date, ISO 8601 format (%aI)
        string                      gan            = 8;  // Author Name (%an)
        string                      gae            = 9;  // Author Email (%ae)
        string                      gcI            = 10; // Committer Date, ISO 8601 format (%cI)
        string                      gcn            = 11; // Committer Name (%cn)
        string                      gce            = 12; // Committer Email (%ce)
        string                      gN             = 13; // Commit Notes (%N)
        string                      gGG            = 14; // GPG Signature, raw (%GG)
        string                      gGS            = 15; // GPG Signer Name (%GS)
        string                      gGK            = 16; // GPG Key ID (%GK)
        string                      filename       = 17; // `autogenpb:unique` `autogenpb:sort`
        string                      comment        = 18; // the git commit message (in patch form)
        string                      patchId        = 19; // patchId `autogenpb:unique`
        string                      commitHash     = 20; // the git commit hash of this patch `autogenpb:sort` `autogenpb:unique`
        string                      newHash        = 21; // new hash
        string                      startHash      = 22; // the start commit hash
        string                      treeHash       = 23; // final tree Hash
        repeated string             Files          = 24; // the filenames this patch changes
        google.protobuf.Timestamp   ctime          = 25; // create time of the patch
        bool                        applied        = 26; // have you applied this patch?
        bool                        upstream       = 27; // has this patch been applied upstream?
        string                      state          = 28; // the 'state' of the patch
}

// this is a "PATCH: [1/x]" series
message Patches {                                        // `autogenpb:marshal` `autogenpb:gui:Patch` `autogenpb:http`
        string                      uuid           = 1;  // `autogenpb:uuid:2679065e-c81d-4a00-aca4-03c158a834fb`
        string                      version        = 2;  // `autogenpb:version:v2.1.0`
        repeated Patch              patches        = 3;
        string                      filename       = 4;  // `autogenpb:save` -- this enables autogenerated pb.Load() and pb.Save()
        string                      Errors         = 5;  // `autogenpb:error`
}