Liking cljdoc? Tell your friends :D

hara.lib.jgit


*dir*clj


blobclj

(blob repo id)

gets a blob according to id

(->> (ObjectId/fromString -project-id-) (blob (repository)) (slurp) (read-string) (second)) => 'hara

gets a blob according to id

(->> (ObjectId/fromString -project-id-)
     (blob (repository))
     (slurp)
     (read-string)
     (second))
=> 'hara
raw docstring

gitclj

(git)
(git dir? & args)

top level form for manipulating

(git) ;;=> [:add ... :tag]

(git :pwd) ;;=> "/Users/chris/Development/zcaudate/lucidity"

(git :init :?) => (contains {:bare anything :directory java.lang.String, :git-dir java.lang.String})

(git :rm :?) => (contains {:filepattern [java.lang.String], :cached anything})

(-> (git :status) keys sort) => [:added :changed :conflicting :conflicting-stage-state :ignored-not-in-index :missing :modified :removed :uncommitted-changes :untracked :untracked-folders]

(first (git :branch :list)) ;; => {:name "refs/heads/master", ;; :object-id "c8fa557ce252dffdfbdd5c1884cf87d41c0f222f", ;; :storage "LOOSE", ;; :peeled? false, ;; :symbolic? false}

top level form for manipulating 

(git)
;;=> [:add ... :tag]

(git :pwd)
;;=> "/Users/chris/Development/zcaudate/lucidity"

(git :init :?)
=> (contains {:bare anything :directory java.lang.String, :git-dir java.lang.String})

(git :rm :?)
=> (contains {:filepattern [java.lang.String], :cached anything})

(-> (git :status) keys sort)
=> [:added :changed :conflicting
    :conflicting-stage-state :ignored-not-in-index
    :missing :modified :removed :uncommitted-changes
    :untracked :untracked-folders]

(first (git :branch :list))
;; => {:name "refs/heads/master",
;;     :object-id "c8fa557ce252dffdfbdd5c1884cf87d41c0f222f",
;;     :storage "LOOSE",
;;     :peeled? false,
;;     :symbolic? false}
raw docstring

git-command-helpclj

(git-command-help cmd)

list all options for a given command

(-> (git-command-help ((first (command/command (command/git-all-commands) [:push])) (Git. (repository)))) keys sort) => [:add :atomic :dry-run :force :output-stream :progress-monitor :push-all :push-options :push-tags :receive-pack :ref-lease-specs :ref-specs :remote :thin]

list all options for a given command

(-> (git-command-help ((first (command/command (command/git-all-commands)
                                               [:push]))
                       (Git. (repository))))
    keys
    sort)
=> [:add :atomic :dry-run :force :output-stream
    :progress-monitor :push-all :push-options
    :push-tags :receive-pack :ref-lease-specs
   :ref-specs :remote :thin]
raw docstring

git-helpclj

(git-help all-commands)

list all commands for the git interface

(git-help (command/git-all-commands)) => [: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]

list all commands for the git interface

(git-help (command/git-all-commands))
=> [: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]
raw docstring

list-commitsclj

(list-commits repo)
(list-commits repo branch)

lists current commits for a particular repository (-> (repository) (list-commits "master") (first)) ;; => {:time #inst "2018-05-27T03:54:52.000-00:00", ;; :id "c8fa557ce252dffdfbdd5c1884cf87d41c0f222f"}

lists current commits for a particular repository
(-> (repository)
    (list-commits "master")
    (first))
;; => {:time #inst "2018-05-27T03:54:52.000-00:00",
;;     :id "c8fa557ce252dffdfbdd5c1884cf87d41c0f222f"}
raw docstring

list-differenceclj

(list-difference repo old)
(list-difference repo old new)

returns a list of modifications from one version to another (-> (list-difference (repo/repository) {:commit "HEAD~3"}) first) ;; => #modify {:new-id "c81c8f4e14c252adecd1d983ce161055d253c62e", ;; :old-id "356a16f27cd0e66d5d1950252bd6ae57851881a0", ;; :new-path "project.clj", ;; :old-path "project.clj", ;; :changes [#replace {:old [50 51], :new [50 51]} ;; #delete {:old [121 122], :new [121 121]} ;; #replace {:old [127 128], :new [126 127]}]}

returns a list of modifications from one version to another
(-> (list-difference (repo/repository)
                     {:commit "HEAD~3"})
    first)
;; => #modify {:new-id "c81c8f4e14c252adecd1d983ce161055d253c62e",
;;             :old-id "356a16f27cd0e66d5d1950252bd6ae57851881a0",
;;             :new-path "project.clj",
;;             :old-path "project.clj",
;;             :changes [#replace {:old [50 51], :new [50 51]}
;;                       #delete {:old [121 122], :new [121 121]}
;;                       #replace {:old [127 128], :new [126 127]}]}
raw docstring

list-file-changesclj

(list-file-changes repo old)
(list-file-changes repo old new)

lists file changes between the previous and current repositories

(list-file-changes (repo/repository) {:commit "HEAD~3"}) ;; => ({:path "project.clj", :type :modify} ;; {:path "test/hara.deploy/manifest/graph/external_test.clj", :type :modify} ;; {:path "test/lucid/system/jvm_test.clj", :type :modify})

lists file changes between the previous and current repositories

(list-file-changes (repo/repository)
                   {:commit "HEAD~3"})
;; => ({:path "project.clj", :type :modify}
;;     {:path "test/hara.deploy/manifest/graph/external_test.clj", :type :modify}
;;     {:path "test/lucid/system/jvm_test.clj", :type :modify})
raw docstring

list-filesclj

(list-files repo)
(list-files repo opts)

list files within a given branch and commit

(list-files (repository) {:commit "77831a" :branch "master"}) ;;=> (".gitignore" ".travis.yml" ....) => vector?

list files within a given branch and commit

(list-files (repository) {:commit "77831a"
                          :branch "master"})
;;=> (".gitignore" ".travis.yml" ....)
=> vector?
raw docstring

rawclj

(raw repo opts)

gives an inputstream for evalution

(-> (raw (repository) {:path "project.clj"}) (slurp) (read-string) (second)) => 'hara

gives an inputstream for evalution

(-> (raw (repository) {:path "project.clj"})
    (slurp)
    (read-string)
    (second))
=> 'hara
raw docstring

repositoryclj

(repository)
(repository path)

creates a repo object for path or the current directory

(repository) ;; #repository "/Users/chris/Development/base/.git" => repository?

creates a repo object for `path` or the current directory

(repository)
;; #repository "/Users/chris/Development/base/.git"
=> repository?
raw docstring

repository?clj

(repository? obj)

checks if the object is a repository

(repository? (repository)) => true

checks if the object is a repository

(repository? (repository))
=> true
raw docstring

resolve-idclj

(resolve-id repo branch x)

resolves to an id given a date or a string

(resolve-id (repository) "master" "77831a") ;; #id "77831a03e8c6c9c0aada87412ec0efb5dadcc7bd" => org.eclipse.jgit.lib.ObjectId

resolves to an id given a date or a string

(resolve-id (repository) "master" "77831a")
;; #id "77831a03e8c6c9c0aada87412ec0efb5dadcc7bd"
=> org.eclipse.jgit.lib.ObjectId
raw docstring

run-commandclj

(run-command pair dir)

runs the command given the type and directory

(run-command (command/command (command/git-all-commands) [:status]) ".")

runs the command given the type and directory

(run-command (command/command (command/git-all-commands)
                              [:status])
            ".")
raw docstring

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

× close