automaton-build.code.vcs

Version Control System.

Proxy to git.

clean-hard-cmd

(clean-hard-cmd interactive?)(clean-hard-cmd)

Returns the command to clean the project as it has came back to the same state than the repository is freshly downloaded.

Use interactive?=false with caution!!!!! (default to true) to ask user confirmation.

clean-state

(clean-state)

Returns a command to detect clean state

clean-state-analyze

(clean-state-analyze res)

Check if the returned value of clean state

clone-file-chain-cmd

(clone-file-chain-cmd repo-url target-dir branch-name file-name)

Returns a map with:

  • file-path where file will be stored.
  • chain-cmd: Chain of command to clone the repo at repo-url into the target-dir () specific file with it’s latest revision.

It’s quick as it ignores all other files, all other branches of the repository and git history.

commit-analyze

(commit-analyze {:keys [cmd-str out], :as res})

Analyze the first failing command to tell if it is the commit, and if the commit was succesful.

  • Adds :nothing-to-commit when this is the case.
  • Adds :is-commit

commit-chain-cmd

(commit-chain-cmd msg)

Returns a chain of commands to commit all changes in the repo int dir, under the message msg.

current-branch-analyze

(current-branch-analyze cmd-res)

Return the current branch from one res returned value.

current-branch-cmd

(current-branch-cmd)

Returns a command to get the name of the current branch.

current-repo-url-analyze

(current-repo-url-analyze {:keys [exit out]})

Returns the url string to push to the origin repo, nil if was failing.

current-repo-url-cmd

(current-repo-url-cmd)

Command to return the current remote url

current-tag-analyze

(current-tag-analyze res)

current-tag-cmd

(current-tag-cmd)

Command to return the the tag of the current commit

find-git-repo

(find-git-repo dir)

Search a git repo in dir of its parent directories.

gh-run-wip?-analyze

(gh-run-wip?-analyze {:keys [exit out]})

gh-run-wip?-cmd

(gh-run-wip?-cmd)

Returns true if the workflow is in progress

git-changes?-analyze

(git-changes?-analyze cmd-res)

Returns true if directory dir is under version control and has pending changes.

git-changes?-cmd

(git-changes?-cmd)

Returns true if directory dir is under version control and has pending changes.

git-setup-dir

(git-setup-dir repo-dir)

Returns the hidden .git directory of app in repo repo-dir

latest-commit-message-cmd

(latest-commit-message-cmd)

Returns a command to get the commit message of the latest commit of the current branch.

latest-commit-sha-cmd

(latest-commit-sha-cmd)

Returns a command to get the current commit sha for the current branch.

merge-cmd

(merge-cmd branch1 branch2)

Merges branch1 into branch2

new-branch-and-switch-chain-cmd

(new-branch-and-switch-chain-cmd branch-name)

Returns a command

one-commit-push-chain-cmd

(one-commit-push-chain-cmd ssh-url branch msg)

Push content of directory repo-dir in branch branch, and in one commit to repo ssh-url.

pull-changes-chain-cmd

(pull-changes-chain-cmd branch)

Returns a command to fetch and pull changes from origin.

push-analyze

(push-analyze {:keys [err], :as res})

Analyze the res of the push-cmd to add :nothing-to-do if no commit was to be pushed.

push-cmd

(push-cmd branch-name force?)

Returns a command to push the local commits of the repo where the command is executed for the branch branch-name.

If force? is true, the push even if commit are conflicting with the remote branch.

push-tag

(push-tag tag)

remote-branch-exists?

(remote-branch-exists? remote-branches local-branch)

Is the local-branch exists on the remote repository at `repo-url.

remote-branches

(remote-branches chain-res)

remote-branches-chain-cmd

(remote-branches-chain-cmd repo-url)

Returns the remote branches for a repo at repo-url.

repo-url-regexp

(repo-url-regexp)

Regexp to validate a repo-url.

shallow-clone-repo-branch-analyze

(shallow-clone-repo-branch-analyze cmd-res)

Adds to the cmd-res keys :inexisting-remote-branch if the repo does not exist, or :inexisting-remote-branch if the branch does not exist.

shallow-clone-repo-branch-cmd

(shallow-clone-repo-branch-cmd repo-url branch-name cloned-dir-name)(shallow-clone-repo-branch-cmd repo-url branch-name)(shallow-clone-repo-branch-cmd repo-url)

Returns command to clone the repository at address repo-url for branch branch-name - only the result of the latest commit (i.e. shallow commit).

spit-hook

(spit-hook app-dir hook-name content)

Spit the content in the hook called hook-name of app-dir repo.

tag

(tag version)(tag version tag-msg)

Creates a tag under name version and message tag-msg.

tag-push-chain-cmd

(tag-push-chain-cmd branch-name dir version tag-msg force?)