git

package
v0.0.0-...-ef45db5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 28

Documentation

Overview

Package git contains Git-related protobuf definitions.

Index

Constants

This section is empty.

Variables

View Source
var (
	Commit_TreeDiff_ChangeType_name = map[int32]string{
		0: "ADD",
		1: "COPY",
		2: "DELETE",
		3: "MODIFY",
		4: "RENAME",
	}
	Commit_TreeDiff_ChangeType_value = map[string]int32{
		"ADD":    0,
		"COPY":   1,
		"DELETE": 2,
		"MODIFY": 3,
		"RENAME": 4,
	}
)

Enum value maps for Commit_TreeDiff_ChangeType.

View Source
var (
	File_Type_name = map[int32]string{
		0: "UNKNOWN",
		1: "TREE",
		2: "BLOB",
	}
	File_Type_value = map[string]int32{
		"UNKNOWN": 0,
		"TREE":    1,
		"BLOB":    2,
	}
)

Enum value maps for File_Type.

View Source
var File_go_chromium_org_luci_common_proto_git_commit_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Commit

type Commit struct {

	// The hex sha1 of the commit.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The hex sha1 of the tree for this commit.
	Tree string `protobuf:"bytes,2,opt,name=tree,proto3" json:"tree,omitempty"`
	// The hex sha1's of each of this commits' parents.
	Parents   []string     `protobuf:"bytes,3,rep,name=parents,proto3" json:"parents,omitempty"`
	Author    *Commit_User `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"`
	Committer *Commit_User `protobuf:"bytes,5,opt,name=committer,proto3" json:"committer,omitempty"`
	// This is the entire unaltered message body.
	Message  string             `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"`
	TreeDiff []*Commit_TreeDiff `protobuf:"bytes,7,rep,name=tree_diff,json=treeDiff,proto3" json:"tree_diff,omitempty"`
	// contains filtered or unexported fields
}

Commit is a single parsed commit as represented in a git log or git show expression.

func (*Commit) Descriptor deprecated

func (*Commit) Descriptor() ([]byte, []int)

Deprecated: Use Commit.ProtoReflect.Descriptor instead.

func (*Commit) GetAuthor

func (x *Commit) GetAuthor() *Commit_User

func (*Commit) GetCommitter

func (x *Commit) GetCommitter() *Commit_User

func (*Commit) GetId

func (x *Commit) GetId() string

func (*Commit) GetMessage

func (x *Commit) GetMessage() string

func (*Commit) GetParents

func (x *Commit) GetParents() []string

func (*Commit) GetTree

func (x *Commit) GetTree() string

func (*Commit) GetTreeDiff

func (x *Commit) GetTreeDiff() []*Commit_TreeDiff

func (*Commit) ProtoMessage

func (*Commit) ProtoMessage()

func (*Commit) ProtoReflect

func (x *Commit) ProtoReflect() protoreflect.Message

func (*Commit) Reset

func (x *Commit) Reset()

func (*Commit) String

func (x *Commit) String() string

type Commit_TreeDiff

type Commit_TreeDiff struct {

	// How this file changed.
	Type    Commit_TreeDiff_ChangeType `protobuf:"varint,1,opt,name=type,proto3,enum=git.Commit_TreeDiff_ChangeType" json:"type,omitempty"`
	OldId   string                     `protobuf:"bytes,2,opt,name=old_id,json=oldId,proto3" json:"old_id,omitempty"`
	OldMode uint32                     `protobuf:"varint,3,opt,name=old_mode,json=oldMode,proto3" json:"old_mode,omitempty"`
	OldPath string                     `protobuf:"bytes,4,opt,name=old_path,json=oldPath,proto3" json:"old_path,omitempty"`
	NewId   string                     `protobuf:"bytes,5,opt,name=new_id,json=newId,proto3" json:"new_id,omitempty"`
	NewMode uint32                     `protobuf:"varint,6,opt,name=new_mode,json=newMode,proto3" json:"new_mode,omitempty"`
	NewPath string                     `protobuf:"bytes,7,opt,name=new_path,json=newPath,proto3" json:"new_path,omitempty"`
	// contains filtered or unexported fields
}

Each TreeDiff represents a single file that's changed between this commit and the "previous" commit, where "previous" depends on the context of how this Commit object was produced (i.e. the specific `git log` invocation, or similar command).

Note that these are an artifact of the `git log` expression, not of the commit itself (since git log has different ways that it could sort the commits in the log, and thus different ways it could calculate these diffs). In particular, you should avoid caching the TreeDiff data using only the Commit.id as the key.

The old_* fields correspond to the matching file in the previous commit (in the case of COPY/DELETE/MODIFY/RENAME), telling its blob hash, file mode and path name.

The new_* fields correspond to the matching file in this commit (in the case of ADD/COPY/MODIFY/RENAME), telling its blob hash, file mode and path name.

func (*Commit_TreeDiff) Descriptor deprecated

func (*Commit_TreeDiff) Descriptor() ([]byte, []int)

Deprecated: Use Commit_TreeDiff.ProtoReflect.Descriptor instead.

func (*Commit_TreeDiff) GetNewId

func (x *Commit_TreeDiff) GetNewId() string

func (*Commit_TreeDiff) GetNewMode

func (x *Commit_TreeDiff) GetNewMode() uint32

func (*Commit_TreeDiff) GetNewPath

func (x *Commit_TreeDiff) GetNewPath() string

func (*Commit_TreeDiff) GetOldId

func (x *Commit_TreeDiff) GetOldId() string

func (*Commit_TreeDiff) GetOldMode

func (x *Commit_TreeDiff) GetOldMode() uint32

func (*Commit_TreeDiff) GetOldPath

func (x *Commit_TreeDiff) GetOldPath() string

func (*Commit_TreeDiff) GetType

func (*Commit_TreeDiff) ProtoMessage

func (*Commit_TreeDiff) ProtoMessage()

func (*Commit_TreeDiff) ProtoReflect

func (x *Commit_TreeDiff) ProtoReflect() protoreflect.Message

func (*Commit_TreeDiff) Reset

func (x *Commit_TreeDiff) Reset()

func (*Commit_TreeDiff) String

func (x *Commit_TreeDiff) String() string

type Commit_TreeDiff_ChangeType

type Commit_TreeDiff_ChangeType int32
const (
	Commit_TreeDiff_ADD    Commit_TreeDiff_ChangeType = 0
	Commit_TreeDiff_COPY   Commit_TreeDiff_ChangeType = 1
	Commit_TreeDiff_DELETE Commit_TreeDiff_ChangeType = 2
	Commit_TreeDiff_MODIFY Commit_TreeDiff_ChangeType = 3
	Commit_TreeDiff_RENAME Commit_TreeDiff_ChangeType = 4
)

func (Commit_TreeDiff_ChangeType) Descriptor

func (Commit_TreeDiff_ChangeType) Enum

func (Commit_TreeDiff_ChangeType) EnumDescriptor deprecated

func (Commit_TreeDiff_ChangeType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Commit_TreeDiff_ChangeType.Descriptor instead.

func (*Commit_TreeDiff_ChangeType) MarshalJSON

func (c *Commit_TreeDiff_ChangeType) MarshalJSON() ([]byte, error)

MarshalJSON returns a string representation of the change.

func (Commit_TreeDiff_ChangeType) Number

func (Commit_TreeDiff_ChangeType) String

func (Commit_TreeDiff_ChangeType) Type

func (*Commit_TreeDiff_ChangeType) UnmarshalJSON

func (c *Commit_TreeDiff_ChangeType) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a string representation of the change.

type Commit_User

type Commit_User struct {
	Name  string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Email string                 `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Time  *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

User represents the (name, email, timestamp) Commit header for author and/or commtter.

func (*Commit_User) Descriptor deprecated

func (*Commit_User) Descriptor() ([]byte, []int)

Deprecated: Use Commit_User.ProtoReflect.Descriptor instead.

func (*Commit_User) GetEmail

func (x *Commit_User) GetEmail() string

func (*Commit_User) GetName

func (x *Commit_User) GetName() string

func (*Commit_User) GetTime

func (x *Commit_User) GetTime() *timestamppb.Timestamp

func (*Commit_User) ProtoMessage

func (*Commit_User) ProtoMessage()

func (*Commit_User) ProtoReflect

func (x *Commit_User) ProtoReflect() protoreflect.Message

func (*Commit_User) Reset

func (x *Commit_User) Reset()

func (*Commit_User) String

func (x *Commit_User) String() string

type File

type File struct {

	// ID is sha1 hash of the file contents
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Path is the path to file, without leading "/".
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// Mode is file mode, e.g. 0100644 (octal, often shows up 33188 in decimal).
	Mode uint32 `protobuf:"varint,3,opt,name=mode,proto3" json:"mode,omitempty"`
	// Type is the file type.
	Type File_Type `protobuf:"varint,4,opt,name=type,proto3,enum=git.File_Type" json:"type,omitempty"`
	// contains filtered or unexported fields
}

File is a single file as represented in a git tree.

func (*File) Descriptor deprecated

func (*File) Descriptor() ([]byte, []int)

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetId

func (x *File) GetId() string

func (*File) GetMode

func (x *File) GetMode() uint32

func (*File) GetPath

func (x *File) GetPath() string

func (*File) GetType

func (x *File) GetType() File_Type

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

func (x *File) ProtoReflect() protoreflect.Message

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type File_Type

type File_Type int32
const (
	File_UNKNOWN File_Type = 0
	File_TREE    File_Type = 1
	File_BLOB    File_Type = 2
)

func (File_Type) Descriptor

func (File_Type) Descriptor() protoreflect.EnumDescriptor

func (File_Type) Enum

func (x File_Type) Enum() *File_Type

func (File_Type) EnumDescriptor deprecated

func (File_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use File_Type.Descriptor instead.

func (File_Type) Number

func (x File_Type) Number() protoreflect.EnumNumber

func (File_Type) String

func (x File_Type) String() string

func (File_Type) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL