CommitOptions

com.worxbend.codeberg4s.repositories.admin.CommitOptions
See theCommitOptions companion object
final case class CommitOptions(branch: Option[BranchName], newBranch: Option[BranchName], message: Option[String], author: Option[CommitIdentity], committer: Option[CommitIdentity], dates: CommitDates, signoff: Boolean, forceOverwriteNewBranch: Boolean)

The settings every contents write shares — the eight properties CreateFileOptions, UpdateFileOptions, DeleteFileOptions and ChangeFilesOptions all declare.

Split into its own type rather than repeated on four commands, so the wire spellings and the semantics live in one place. Rule 4 of com.worxbend.codeberg4s.codec.WireConventions is the same argument on the codec side.

==Branching==

branch says where to read the current state from; newBranch says to create a branch there first and commit onto that instead. Together they are how a caller opens a change for review without touching the default branch. forceOverwriteNewBranch is the escape hatch for the case where newBranch already exists — it force-pushes, and it is off by default because a silent force-push is not something a library should do on its own initiative.

Value parameters

author

who the commit is attributed to — see CommitIdentity

branch

the branch to base the change on. Absent means the repository's default branch

committer

who applied it — see CommitIdentity

dates

the commit's author and committer dates — see CommitDates

forceOverwriteNewBranch

force-push when newBranch already exists. See the note above

message

the commit message. Absent lets Forgejo compose its own, which names the operation and the path

newBranch

a branch to create from branch and commit onto. Absent commits onto branch itself

signoff

add a Signed-off-by trailer for the committer

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Attributes the commit to identity.

Attributes the commit to identity.

Attributes

Records identity as the committer.

Records identity as the committer.

Attributes

Dates the commit explicitly rather than letting Forgejo use the time of the request.

Dates the commit explicitly rather than letting Forgejo use the time of the request.

Attributes

def describedAs(text: String): CommitOptions

Uses text as the commit message.

Uses text as the commit message.

Attributes

Bases the change on base rather than the repository's default branch.

Bases the change on base rather than the repository's default branch.

Attributes

Creates target from the base branch and commits onto it.

Creates target from the base branch and commits onto it.

Attributes

Force-pushes when the new branch already exists. See the type note before choosing this.

Force-pushes when the new branch already exists. See the type note before choosing this.

Attributes

Adds a Signed-off-by trailer.

Adds a Signed-off-by trailer.

Attributes

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product