From efe70802881464ff43e6504eda1cdec64bdd7ec3 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Tue, 3 Aug 2010 16:35:02 +0100 Subject: [PATCH 1/2] Allow annotated tags anywhere in the graph. --- magit.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/magit.el b/magit.el index 6970d9b7..986fd374 100644 --- a/magit.el +++ b/magit.el @@ -1695,6 +1695,7 @@ FUNC should leave point at the end of the modified region" (define-key map (kbd "h") 'magit-reflog-head) (define-key map (kbd "H") 'magit-reflog) (define-key map (kbd "t") 'magit-tag) + (define-key map (kbd "T") 'magit-annotated-tag) map)) (defvar magit-reflog-mode-map @@ -3244,7 +3245,8 @@ toggled on. When it's toggled on for the first time, return (sign-off (if sign-off-field (equal (cdr sign-off-field) "yes") magit-commit-signoff)) - (tag (cdr (assq 'tag fields))) + (tag-rev (cdr (assq 'tag-rev fields))) + (tag-name (cdr (assq 'tag-name fields))) (author (cdr (assq 'author fields)))) (magit-log-edit-push-to-comment-ring (buffer-string)) (magit-log-edit-setup-author-env author) @@ -3254,8 +3256,8 @@ toggled on. When it's toggled on for the first time, return (insert "(Empty description)\n")) (let ((commit-buf (current-buffer))) (with-current-buffer (magit-find-buffer 'status default-directory) - (cond (tag - (magit-run-git-with-input commit-buf "tag" tag "-a" "-F" "-")) + (cond (tag-name + (magit-run-git-with-input commit-buf "tag" tag-name "-a" "-F" "-" tag-rev)) (t (apply #'magit-run-async-with-input commit-buf magit-git-executable @@ -3263,7 +3265,7 @@ toggled on. When it's toggled on for the first time, return (list "commit" "-F" "-") (if (and commit-all (not allow-empty)) '("--all") '()) (if amend '("--amend") '()) - (if allow-empty '("--allow-empty")) + (if allow-empty '("--allow-empty")) (if sign-off '("--signoff") '()))))))) (erase-buffer) (bury-buffer) @@ -3324,7 +3326,6 @@ This means that the eventual commit does 'git commit --allow-empty'." (if (y-or-n-p "Rebase in progress. Continue it? ") (magit-run-git "rebase" "--continue"))) (t - (magit-log-edit-set-field 'tag nil) (when (and magit-commit-all-when-nothing-staged (not (magit-anything-staged-p))) (cond ((eq magit-commit-all-when-nothing-staged 'ask-stage) @@ -3403,11 +3404,15 @@ This means that the eventual commit does 'git commit --allow-empty'." (magit-read-rev "Place tag on: " (or (magit-default-rev) "HEAD")))) (magit-run-git "tag" name rev)) -(magit-define-command annotated-tag (name) +(magit-define-command annotated-tag (name rev) "Start composing an annotated tag with the given NAME. Tag will point to the current 'HEAD'." - (interactive "sNew annotated tag name: ") - (magit-log-edit-set-field 'tag name) + (interactive + (list + (read-string "Tag name: ") + (magit-read-rev "Place tag on: " (or (magit-default-rev) "HEAD")))) + (magit-log-edit-set-field 'tag-name name) + (magit-log-edit-set-field 'tag-rev rev) (magit-pop-to-log-edit "tag")) ;;; Stashing From 721b70c2396c0f7d14df70ab86af3d0665390157 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Wed, 4 Aug 2010 10:11:28 +0100 Subject: [PATCH 2/2] Bit more information in the commit buffer. --- magit.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index 986fd374..cc61be88 100644 --- a/magit.el +++ b/magit.el @@ -2464,9 +2464,12 @@ insert a line to tell how to insert more of them" (magit-create-buffer-sections (magit-git-section nil nil 'magit-wash-commit - "log" "--max-count=1" + "log" + "--decorate=full" + "--max-count=1" "--pretty=medium" - "--cc" "-p" commit))) + "--cc" + "-p" commit))) (define-minor-mode magit-commit-mode "Minor mode to view git commit"