Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 7037526d authored by Ryan C. Thompson's avatar Ryan C. Thompson

Implement support for :checkout property in git recipes

parent 2e5fd494
......@@ -40,9 +40,18 @@ found."
(name (format "*git clone %s*" package))
(source (el-get-package-def package))
(branch (plist-get source :branch))
(args (if branch
(list "--no-pager" "clone" "-b" branch url pname)
(list "--no-pager" "clone" url pname)))
(checkout (plist-get source :checkout))
(clone-args (append '("--no-pager" "clone")
(cond
;; With :checkout, the "git checkout"
;; command is a separate step, so don't
;; do it during cloning.
(checkout '("--no-checkout"))
;; With a specified branch, check that branch out
(branch (list "-b" branch))
;; Otherwise, just checkout the default branch
(t nil))
(list url pname)))
(ok (format "Package %s installed." package))
(ko (format "Could not install package %s." package)))
(el-get-start-process-list
......@@ -51,9 +60,17 @@ found."
:buffer-name ,name
:default-directory ,el-get-dir
:program ,git-executable
:args ,args
:args ,clone-args
:message ,ok
:error ,ko)
,(when checkout
(list :command-name (format "*git checkout %s*" checkout)
:buffer-name name
:default-directory pdir
:program git-executable
:args (list "--no-pager" "checkout" checkout)
:message (format "git checkout %s ok" checkout)
:error (format "Could not checkout %s for package %s" checkout package)))
(:command-name "*git submodule update*"
:buffer-name ,name
:default-directory ,pdir
......@@ -68,18 +85,30 @@ found."
(let* ((git-executable (el-get-executable-find "git"))
(pdir (el-get-package-directory package))
(name (format "*git pull %s*" package))
(source (el-get-package-def package))
(checkout (plist-get source :checkout))
;; When dealing with a specific checkout, we cannot use
;; "pull", but must instead use "fetch" and then "checkout".
(pull-args (list "--no-pager" (if checkout "fetch" "pull")))
(ok (format "Pulled package %s." package))
(ko (format "Could not update package %s." package)))
(el-get-start-process-list
package
`((:command-name ,name
:buffer-name ,name
:default-directory ,pdir
:program ,git-executable
:args ( "--no-pager" "pull")
:args ,pull-args
:message ,ok
:error ,ko)
,(when checkout
(list :command-name (format "*git checkout %s*" checkout)
:buffer-name name
:default-directory pdir
:program git-executable
:args (list "--no-pager" "checkout" checkout)
:message (format "git checkout %s ok" checkout)
:error (format "Could not checkout %s for package %s" checkout package)))
(:command-name "*git submodule update*"
:buffer-name ,name
:default-directory ,pdir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment