path: root/contrib/emacs
diff options
authorDavid Kågedal <>2009-07-31 07:23:09 (GMT)
committerJunio C Hamano <>2009-08-06 20:30:36 (GMT)
commit8918f5cf962866c2bb36bdf6b417bfcdb523280a (patch)
tree372aa3e8b3b31edfafb71afa29b7ed68110b6083 /contrib/emacs
parent3f55e4107f7906134df029f9a5c44864f9258110 (diff)
git.el: Clarify documentation of git-commit-tree
Signed-off-by: David Kågedal <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/emacs')
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index eace9c1..8c70ad8 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -429,16 +429,19 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME)."
(git-call-process-string-display-error "write-tree"))))
-(defun git-commit-tree (buffer tree head)
- "Call git-commit-tree with buffer as input and return the resulting commit SHA1."
+(defun git-commit-tree (buffer tree parent)
+ "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))
(author-email (git-get-committer-email))
(subject "commit (initial): ")
author-date log-start log-end args coding-system-for-write)
- (when head
+ (when parent
(setq subject "commit: ")
(push "-p" args)
- (push head args))
+ (push parent args))
(with-current-buffer buffer
(goto-char (point-min))
@@ -474,7 +477,7 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME)."
(apply #'git-run-command-region
buffer log-start log-end env
"commit-tree" tree (nreverse args))))))
- (when commit (git-update-ref "HEAD" commit head subject))
+ (when commit (git-update-ref "HEAD" commit parent subject))
(defun git-empty-db-p ()