summaryrefslogtreecommitdiff
path: root/stat.proto
blob: e98d73e8a0f4d4fe6b19fad1ec27f456988a6857 (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
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

syntax = "proto3";

package gitpb;

import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
//
// this is dumb, but works for now. duplicate information is stored sometimes
// this is however, fast. TODO: redo this .proto file someday

message GitRef {
        enum RefType {
                UNKNOWN = 0;
                LOCAL  = 1;
                REMOTE = 2;
                TAG    = 3;
        }
        string                      name                 = 1;  //
        string                      remote               = 2;  // blank unless REMOTE
        RefType                     type                 = 3;  // is set by git as the master branch
        string                      subject              = 4;  // git tag subject
}
// TODO: use patch.proto instead
message Stat {
        string                      patchId              = 1;  // `autogenpb:unique` `autogenpb:sort`
        string                      hash                 = 2;  // `autogenpb:unique` `autogenpb:sort`
        string                      treeHash             = 3;  // `autogenpb:unique` `autogenpb:sort`
        google.protobuf.Timestamp   authorTime           = 4;  // `autogenpb:unique` `autogenpb:sort`
        google.protobuf.Timestamp   commitTime           = 5;  // `autogenpb:unique` `autogenpb:sort`
        string                      sanitizedSubject     = 6;  //
        string                      name                 = 7;  //
        string                      remote               = 8;  // blank unless REMOTE
        string                      subject              = 9;  // git tag subject
        GitRef.RefType              type                 = 10; // is set by git as the master branch
        repeated GitRef             refs                 = 11; // this is dumb, but works for now. duplicate information is stored sometimes
}

// normally stored as .git/*.pb cache files
// TODO: use patch.proto instead
message Stats {                                                // `autogenpb:marshal` `autogenpb:gui` `autogenpb:http`
        string                      uuid                 = 1;  // `autogenpb:uuid:ba236558-f8a1-4c47-a14a-8856a24d3f72`
        string                      version              = 2;  // `autogenpb:version:v0.0.3`
        repeated Stat               stats                = 3;
        string                      filename             = 4;  // `autogenpb:save` -- this enables autogenerated pb.Load() and pb.Save()
        string                      head                 = 5;  // the current origin hash
        google.protobuf.Timestamp   mtime                = 6;  // mtime for .git/
        string                      name                 = 7;  // the current origin hash
}