// Copyright 2020-2025 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package buf.alpha.registry.v1alpha1;

import "google/protobuf/timestamp.proto";

// GitIdentity is a Git user identity, typically either an author or a committer.
message GitIdentity {
  // Name is the name of the Git identity. This is not the BSR user's username.
  string name = 1;
  // Email is the email of the Git identity. This is not the BSR user's email.
  string email = 2;
  // Time is the time at which this identity was captured.
  google.protobuf.Timestamp time = 3;
}

// GitCommitInformation is the information associated with a Git commit.
// This always includes the hash.
// The author and/or committer user identities are included when available.
message GitCommitInformation {
  // Hash is the SHA1 hash of the git commit.
  string hash = 1;
  // Author is metadata associated with the author of the git commit.
  // This may not always be available, so it is not always populated.
  GitIdentity author = 2;
  // Committer is the metadata associated with the committer of the git commit.
  // This may not always be available, so it is not always populated.
  GitIdentity committer = 3;
}
