From: "David Kågedal" <davidk@lysator.liu.se>
To: Alexandre Julliard <julliard@winehq.org>
Cc: "David Kågedal" <davidk@lysator.liu.se>
Subject: [PATCH] git.el: Clarify documentation of git-commit-tree
Date: Fri, 31 Jul 2009 09:23:09 +0200 [thread overview]
Message-ID: <1249024989-27826-1-git-send-email-davidk@lysator.liu.se> (raw)
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
contrib/emacs/git.el | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index face333..3a0bda3 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -436,16 +436,19 @@ Each entry is a cons of (SHORT-NAME . FULL-NAME)."
(git-get-string-sha1
(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))
(if
@@ -481,7 +484,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))
commit)))
(defun git-empty-db-p ()
--
1.6.4.rc3.21.g3b9e
reply other threads:[~2009-07-31 7:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1249024989-27826-1-git-send-email-davidk@lysator.liu.se \
--to=davidk@lysator.liu.se \
--cc=julliard@winehq.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).