Liking cljdoc? Tell your friends :D

clj-github.changeset

Provides a functional api to make commits. It is centered around the concept of a changeset.

A changeset is an object that accumulates a series of changes to the repository that will eventually generate a commit.

A changeset can be created by calling from-revision or from-branch!.

A changeset can be "changed" by using put-content, update-content, delete, etc. Those functions don't actually change the changeset but return a new one.

get-content will return the content of a file correspondent to the state of the provided changeset.

Once the necessary changes have been made, commit! will generate a commit having the changeset base revision as its parent.

commit! will not update the head of the branch, but create-branch! and update-branch! can be used to do that. That allows one to make a series of commits and only change the branch when they are ready to, which makes it easier to make processes idempontent, since if anything wrong happens the intermediary commits can just be ignored.

Note: The internal format of the changeset is considered an implementation detail and should not be relied upon. Always create a changeset using one of the factory functions (e.g. from-revision, from-branch).

Provides a functional api to make commits. It is centered around the concept of a changeset.

A changeset is an object that accumulates a series of changes to the repository that will eventually generate a commit.

A changeset can be created by calling `from-revision` or `from-branch!`.

A changeset can be "changed" by using `put-content`, `update-content`, `delete`, etc. Those functions don't actually
change the changeset but return a new one.

`get-content` will return the content of a file correspondent to the state of the provided changeset.

Once the necessary changes have been made, `commit!` will generate a commit having the changeset base revision as its parent.

`commit!` will not update the head of the branch, but `create-branch!` and `update-branch!` can be used to do that.
That allows one to make a series of commits and only change the branch when they are ready to, which makes it easier
to make processes idempontent, since if anything wrong happens the intermediary commits can just be ignored.

Note: The internal format of the changeset is considered an implementation detail and should not be relied upon.
Always create a changeset using one of the factory functions (e.g. `from-revision`, `from-branch`).
raw docstring

commit!clj

(commit! {:keys [client org repo base-revision changes] :as changeset} message)

Commits the changeset returning a new changeset based on the new commit revision. If the changeset does not contain any changes, calling this function is a no-op. This function does not update the HEAD of a branch.

Commits the changeset returning a new changeset based on the new commit revision.
If the changeset does not contain any changes, calling this function is a no-op.
This function does not update the HEAD of a branch.
sourceraw docstring

create-branch!clj

(create-branch! {:keys [client org repo base-revision] :as changeset} branch)

Creates a branch that points to the base revision of the given changeset. Returns a new changeset with the branch associated.

The changeset should not contain any changes.

Creates a branch that points to the base revision of the given changeset. Returns a new changeset with the branch associated.

The changeset should not contain any changes.
sourceraw docstring

deleteclj

(delete revision path)

Returns a new changeset with the file under path deleted.

Returns a new changeset with the file under path deleted.
sourceraw docstring

delete-branch!clj

(delete-branch! {:keys [client org repo branch] :as changeset})

Deletes the branch associated with the changeset, returning the changeset with the branch excluded.

The changeset should not contain any changes.

Deletes the branch associated with the changeset, returning the changeset with the branch excluded.

The changeset should not contain any changes.
sourceraw docstring

dirty?clj

(dirty? {:keys [changes]})

Returns true if changes were made to the given changeset

Returns true if changes were made to the given changeset
sourceraw docstring

from-branch!clj

(from-branch! client org repo branch)

Creates a new changeset based on the current HEAD of a given branch.

Creates a new changeset based on the current HEAD of a given branch.
sourceraw docstring

from-revisionclj

(from-revision client org repo revision)

Creates a new changeset based on a given git revision (hexadecimal sha).

Creates a new changeset based on a given git revision (hexadecimal sha).
sourceraw docstring

get-contentclj

(get-content {:keys [client org repo base-revision changes]} path)

Returns the content of a file (as a string) for a given changeset.

Returns the content of a file (as a string) for a given changeset.
sourceraw docstring

orphanclj

(orphan client org repo)
source

put-contentclj

(put-content changeset path content)

Returns a new changeset with the file under path with new content. content can be a string or a byte-array. It creates a new file if it does not exist yet.

Returns a new changeset with the file under path with new content.
`content` can be a string or a byte-array.
It creates a new file if it does not exist yet.
sourceraw docstring

update-branch!clj

(update-branch! {:keys [client org repo base-revision branch] :as changeset})

Updates a branch to point to the base revision of the given changeset. Returns the changeset unchanged.

The changeset should not contain any changes.

Updates a branch to point to the base revision of the given changeset. Returns the changeset unchanged.

The changeset should not contain any changes.
sourceraw docstring

update-contentclj

(update-content revision path update-fn)

Returns a new changeset with the file under path with new content return by update-fn. update-fn should be an 1-arg function that receives the current content of the file.

Returns a new changeset with the file under path with new content return by `update-fn`.
`update-fn` should be an 1-arg function that receives the current content of the file.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close