Liking cljdoc? Tell your friends :D

lucid.git.api.command


apply-with-coercionclj

(apply-with-coercion {:keys [params] :as ele} args)

applies inputs with coercion included (let [init-command (Git/init) set-dir (reflect/query-class init-command [:# "setGitDir"])] (->> (apply-with-coercion set-dir [init-command ".git"]) (reflect/delegate) (into {}))) => {:directory nil, :bare false, :gitDir (io/file ".git")}

applies inputs with coercion included
(let [init-command (Git/init)
      set-dir  (reflect/query-class init-command [:# "setGitDir"])]
  (->> (apply-with-coercion set-dir [init-command ".git"])
       (reflect/delegate)
       (into {})))
=> {:directory nil, :bare false, :gitDir (io/file ".git")}
raw docstring

commandclj

(command all-commands [input & more])

returns a command based on keyword input

(command (git-all-commands) [:checkout]) ;;=> [#[checkout :: (org.eclipse.jgit.api.Git) -> org.eclipse.jgit.api.CheckoutCommand] nil]

returns a command based on keyword input

(command (git-all-commands) [:checkout])
;;=> [#[checkout :: (org.eclipse.jgit.api.Git) -> org.eclipse.jgit.api.CheckoutCommand] nil]
raw docstring

command-initialize-inputsclj

(command-initialize-inputs command inputs)

initialize inputs for a particular command (->> (Git/init) (reflect/delegate) (into {})) => {:directory nil, :bare false, :gitDir nil}

(-> (Git/init) (command-initialize-inputs [:bare true :git-dir (io/file ".git")]) (reflect/delegate) (->> (into {}))) => {:directory nil, :bare true, :gitDir (io/file ".git")}

initialize inputs for a particular command 
(->> (Git/init)
     (reflect/delegate)
     (into {}))
=> {:directory nil, :bare false, :gitDir nil}

(-> (Git/init)
    (command-initialize-inputs [:bare true
                                :git-dir  (io/file ".git")])
    (reflect/delegate)
    (->> (into {})))
=>  {:directory nil, :bare true, :gitDir (io/file ".git")}
raw docstring

command-inputclj

(command-input opt)

grabs the input type for a particular command

(-> (Git/init) (command-options) :bare (command-input)) => Boolean/TYPE

(-> (Git/init) (command-options) :directory (command-input)) => java.lang.String

grabs the input type for a particular command

(-> (Git/init)
    (command-options)
    :bare
    (command-input))
=> Boolean/TYPE

(-> (Git/init)
    (command-options)
    :directory
    (command-input))
=> java.lang.String
raw docstring

command-optionsclj

(command-options command)

list options for a particular command

(->> (command-options (Git/init)) (reduce-kv (fn [m k v] (assoc m k (command-input v))) {})) => {:git-dir String, :directory String, :bare Boolean/TYPE}

list options for a particular command

(->> (command-options (Git/init))
     (reduce-kv (fn [m k v]
                  (assoc m k (command-input v)))
                {}))
=> {:git-dir String, :directory String, :bare Boolean/TYPE}
raw docstring

git-all-commandsclj

(git-all-commands)

list all commands that work with git (-> (git-all-commands) keys sort) => '(:add :apply :archive :blame :branch :checkout :cherry :clean :clone :commit :describe :diff :fetch :gc :init :log :ls :merge :name :notes :pull :push :rebase :reflog :remote :reset :revert :rm :stash :status :submodule :tag)

(->> (git-all-commands) (filter (fn [[k v]] (not (empty? v)))) (into {})) => {:cherry #{:pick}, :name #{:rev}, :submodule #{:init :update :sync :status :add}, :ls #{:remote}, :clone #{:repository}, :notes #{:remove :list :add :show}, :remote #{:add :list :remove :set}, :stash #{:create :drop :list :apply}, :tag #{:delete :list}, :branch #{:create :delete :rename :list}}

list all commands that work with git
 (-> (git-all-commands) keys sort)
 => '(:add :apply :archive :blame :branch :checkout :cherry :clean :clone :commit :describe :diff :fetch :gc :init :log :ls :merge :name :notes :pull :push :rebase :reflog :remote :reset :revert :rm :stash :status :submodule :tag)
 
(->> (git-all-commands)
     (filter (fn [[k v]] (not (empty? v))))
     (into {}))
=> {:cherry #{:pick},
    :name #{:rev},
    :submodule #{:init :update :sync :status :add},
    :ls #{:remote},
    :clone #{:repository},
    :notes #{:remove :list :add :show},
    :remote #{:add :list :remove :set},
    :stash #{:create :drop :list :apply},
    :tag #{:delete :list},
    :branch #{:create :delete :rename :list}}
raw docstring

git-elementclj

(git-element keywords)

gets an element based on hara.reflect

(git-element [:checkout]) ;;=> #[checkout :: (org.eclipse.jgit.api.Git) -> org.eclipse.jgit.api.CheckoutCommand]

gets an element based on `hara.reflect`

(git-element [:checkout])
;;=> #[checkout :: (org.eclipse.jgit.api.Git) -> org.eclipse.jgit.api.CheckoutCommand]
raw docstring

may-coerceclj

(may-coerce param arg)

if possible, coerce the value into the type, else throw exception

(may-coerce java.io.File "path") ;;=> #// "path"

if possible, coerce the value into the type, else throw exception

(may-coerce java.io.File "path")
;;=> #// "path" 
raw docstring

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

× close