git.el: Clarify documentation of git-commit-tree

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
David Kågedal
2009-07-31 09:23:09 +02:00
committed by Junio C Hamano
parent 3f55e4107f
commit 8918f5cf96

View File

@ -429,16 +429,19 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME)."
(git-get-string-sha1 (git-get-string-sha1
(git-call-process-string-display-error "write-tree")))) (git-call-process-string-display-error "write-tree"))))
(defun git-commit-tree (buffer tree head) (defun git-commit-tree (buffer tree parent)
"Call git-commit-tree with buffer as input and return the resulting commit SHA1." "Create a commit and possibly update HEAD.
Create a commit with the message in BUFFER using the tree with hash TREE.
Use PARENT as the parent of the new commit. If PARENT is the current \"HEAD\",
update the \"HEAD\" reference to the new commit."
(let ((author-name (git-get-committer-name)) (let ((author-name (git-get-committer-name))
(author-email (git-get-committer-email)) (author-email (git-get-committer-email))
(subject "commit (initial): ") (subject "commit (initial): ")
author-date log-start log-end args coding-system-for-write) author-date log-start log-end args coding-system-for-write)
(when head (when parent
(setq subject "commit: ") (setq subject "commit: ")
(push "-p" args) (push "-p" args)
(push head args)) (push parent args))
(with-current-buffer buffer (with-current-buffer buffer
(goto-char (point-min)) (goto-char (point-min))
(if (if
@ -474,7 +477,7 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME)."
(apply #'git-run-command-region (apply #'git-run-command-region
buffer log-start log-end env buffer log-start log-end env
"commit-tree" tree (nreverse args)))))) "commit-tree" tree (nreverse args))))))
(when commit (git-update-ref "HEAD" commit head subject)) (when commit (git-update-ref "HEAD" commit parent subject))
commit))) commit)))
(defun git-empty-db-p () (defun git-empty-db-p ()