{"thread":{"id":"20310","subject":"[PATCH] git.el: Clarify documentation of git-commit-tree","startedAt":"2009-07-31T07:23:09Z","lastAt":"2009-07-31T07:23:09Z","messageCount":1,"participants":["David Kågedal"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"119218","messageId":"1249024989-27826-1-git-send-email-davidk@lysator.liu.se","threadId":"20310","inReplyTo":null,"subject":"[PATCH] git.el: Clarify documentation of git-commit-tree","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2009-07-31T07:23:09Z","receivedAt":"2009-07-31T07:23:09Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Signed-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n contrib/emacs/git.el |   13 ++++++++-----\n 1 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex face333..3a0bda3 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -436,16 +436,19 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME).\"\n     (git-get-string-sha1\n      (git-call-process-string-display-error \"write-tree\"))))\n \n-(defun git-commit-tree (buffer tree head)\n-  \"Call git-commit-tree with buffer as input and return the resulting commit SHA1.\"\n+(defun git-commit-tree (buffer tree parent)\n+  \"Create a commit and possibly update HEAD.\n+Create a commit with the message in BUFFER using the tree with hash TREE.\n+Use PARENT as the parent of the new commit. If PARENT is the current \\\"HEAD\\\",\n+update the \\\"HEAD\\\" reference to the new commit.\"\n   (let ((author-name (git-get-committer-name))\n         (author-email (git-get-committer-email))\n         (subject \"commit (initial): \")\n         author-date log-start log-end args coding-system-for-write)\n-    (when head\n+    (when parent\n       (setq subject \"commit: \")\n       (push \"-p\" args)\n-      (push head args))\n+      (push parent args))\n     (with-current-buffer buffer\n       (goto-char (point-min))\n       (if\n@@ -481,7 +484,7 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME).\"\n               (apply #'git-run-command-region\n                      buffer log-start log-end env\n                      \"commit-tree\" tree (nreverse args))))))\n-      (when commit (git-update-ref \"HEAD\" commit head subject))\n+      (when commit (git-update-ref \"HEAD\" commit parent subject))\n       commit)))\n \n (defun git-empty-db-p ()\n-- \n1.6.4.rc3.21.g3b9e\n"}]}