From 4478bbb11b137b72c2c623383a1dc65eda8394ed Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 20:06:31 -0700 Subject: [PATCH 01/18] make checkout update modeline --- magit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index e2b5c64f..e325756c 100644 --- a/magit.el +++ b/magit.el @@ -2784,7 +2784,9 @@ If REVISION is a remote branch, offer to create a local tracking branch. (interactive (list (magit-read-rev "Switch to" (magit-default-rev)))) (if revision (if (not (magit-maybe-create-local-tracking-branch revision)) - (magit-run-git "checkout" (magit-rev-to-git revision))))) + (progn + (magit-run-git "checkout" (magit-rev-to-git revision)) + (magit-update-vc-modeline default-directory))))) (defun magit-read-create-branch-args () (let* ((cur-branch (magit-get-current-branch)) From 05c3e6fd10a2bd98483e93d78e072f73d30ebbd2 Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 20:46:41 -0700 Subject: [PATCH 02/18] Checkout should ask to save some buffers if magit-save-some-buffers is non-nil. And since this functionality is now used in three places I also created a helper function to do it. --- magit.el | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/magit.el b/magit.el index e325756c..1ecf1b8c 100644 --- a/magit.el +++ b/magit.el @@ -2658,14 +2658,35 @@ insert a line to tell how to insert more of them" :lighter () :keymap magit-status-mode-map) +(defun magit-save-some-buffers (&optional msg pred) + "Save some buffers if variable `magit-save-some-buffers' is non-nil. +If variable `magit-save-some-buffers' is set to 'dontask then +don't ask the user before saving the buffers, just go ahead and +do it. + +Optional argument MSG is displayed in the minibuffer if variable +`magit-save-some-buffers' is nil. + +Optional second argument PRED determines which buffers are considered: +If PRED is nil, all the file-visiting buffers are considered. +If PRED is t, then certain non-file buffers will also be considered. +If PRED is a zero-argument function, it indicates for each buffer whether +to consider it or not when called with that buffer current." + (interactive) + (if magit-save-some-buffers + (save-some-buffers + (eq magit-save-some-buffers 'dontask) + pred) + (when msg + (message msg)))) + ;;;###autoload (defun magit-status (dir) (interactive (list (or (and (not current-prefix-arg) (magit-get-top-dir default-directory)) (magit-read-top-dir (and (consp current-prefix-arg) (> (car current-prefix-arg) 4)))))) - (if magit-save-some-buffers - (save-some-buffers (eq magit-save-some-buffers 'dontask))) + (magit-save-some-buffers) (let ((topdir (magit-get-top-dir dir))) (unless topdir (when (y-or-n-p (format "There is no Git repository in %S. Create one? " @@ -2785,6 +2806,7 @@ If REVISION is a remote branch, offer to create a local tracking branch. (if revision (if (not (magit-maybe-create-local-tracking-branch revision)) (progn + (magit-save-some-buffers) (magit-run-git "checkout" (magit-rev-to-git revision)) (magit-update-vc-modeline default-directory))))) @@ -4260,12 +4282,9 @@ With prefix force the removal even it it hasn't been merged." (kill-buffer buffer-C) (when (bufferp buffer-Ancestor) (kill-buffer buffer-Ancestor)) (set-window-configuration windows) - (if magit-save-some-buffers - (save-some-buffers - (eq magit-save-some-buffers 'dontask) - (lambda () - (eq (current-buffer) file-buffer))) - (message "Conflict resolution finished; you may save the buffer")))))))) + (magit-save-some-buffers + "Conflict resolution finished; you may save the buffer" + (lambda () (eq (current-buffer) file-buffer))))))))) (defun magit-interactive-resolve-item () (interactive) From feeb8cd46c80d6a86ff775f27da5b2d6ee5f3a78 Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 20:56:26 -0700 Subject: [PATCH 03/18] like checkout, create-branch should also query if the user wants to save buffers and also update the modeline when the branch has been switched. --- magit.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index 1ecf1b8c..0a5720bb 100644 --- a/magit.el +++ b/magit.el @@ -2823,11 +2823,15 @@ Fails if working tree or staging area contain uncommitted changes. (interactive (magit-read-create-branch-args)) (if (and branch (not (string= branch "")) parent) + (magit-save-some-buffers) + (progn + (magit-save-some-buffers) (magit-run-git "checkout" "-b" branch (append magit-custom-options - (magit-rev-to-git parent))))) + (magit-rev-to-git parent))) + (magit-update-vc-modeline default-directory)))) (defun magit-delete-branch (branch) "Asks for a branch and deletes it. From 2a2a533b09f660da5ab8808fa306193edb284436 Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 21:02:12 -0700 Subject: [PATCH 04/18] remove accidental duplicate line --- magit.el | 1 - 1 file changed, 1 deletion(-) diff --git a/magit.el b/magit.el index 0a5720bb..1624d437 100644 --- a/magit.el +++ b/magit.el @@ -2823,7 +2823,6 @@ Fails if working tree or staging area contain uncommitted changes. (interactive (magit-read-create-branch-args)) (if (and branch (not (string= branch "")) parent) - (magit-save-some-buffers) (progn (magit-save-some-buffers) (magit-run-git "checkout" "-b" From d8d831c187a1c2dfb2bc84f647b2ab904d0eb979 Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 21:03:59 -0700 Subject: [PATCH 05/18] since there is no else clause, we can turn the if statement into a when and get rid of the progn. --- magit.el | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/magit.el b/magit.el index 1624d437..8491d604 100644 --- a/magit.el +++ b/magit.el @@ -2804,11 +2804,10 @@ If REVISION is a remote branch, offer to create a local tracking branch. \('git checkout [-b] REVISION')." (interactive (list (magit-read-rev "Switch to" (magit-default-rev)))) (if revision - (if (not (magit-maybe-create-local-tracking-branch revision)) - (progn - (magit-save-some-buffers) - (magit-run-git "checkout" (magit-rev-to-git revision)) - (magit-update-vc-modeline default-directory))))) + (when (not (magit-maybe-create-local-tracking-branch revision)) + (magit-save-some-buffers) + (magit-run-git "checkout" (magit-rev-to-git revision)) + (magit-update-vc-modeline default-directory)))) (defun magit-read-create-branch-args () (let* ((cur-branch (magit-get-current-branch)) @@ -2821,16 +2820,15 @@ If REVISION is a remote branch, offer to create a local tracking branch. Fails if working tree or staging area contain uncommitted changes. \('git checkout -b BRANCH REVISION')." (interactive (magit-read-create-branch-args)) - (if (and branch (not (string= branch "")) - parent) - (progn - (magit-save-some-buffers) - (magit-run-git "checkout" "-b" - branch - (append - magit-custom-options - (magit-rev-to-git parent))) - (magit-update-vc-modeline default-directory)))) + (when (and branch (not (string= branch "")) + parent) + (magit-save-some-buffers) + (magit-run-git "checkout" "-b" + branch + (append + magit-custom-options + (magit-rev-to-git parent))) + (magit-update-vc-modeline default-directory))) (defun magit-delete-branch (branch) "Asks for a branch and deletes it. From 17753d31fd66e73a954588152c43caa23fd18e13 Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 21:12:05 -0700 Subject: [PATCH 06/18] added myself as a contributor. --- magit.el | 1 + 1 file changed, 1 insertion(+) diff --git a/magit.el b/magit.el index 8491d604..1169aebe 100644 --- a/magit.el +++ b/magit.el @@ -30,6 +30,7 @@ ;; Copyright (C) 2010 Yann Hodique. ;; Copyright (C) 2010 Ævar Arnfjörð Bjarmason. ;; Copyright (C) 2010 Óscar Fuentes. +;; Copyright (C) 2010 Aaron Culich. ;; Author: Marius Vollmer ;; Maintainer: Phil Jackson From 36ace412b65dea5bca3d4fed99428c51e4881a55 Mon Sep 17 00:00:00 2001 From: Aaron Culich Date: Mon, 20 Sep 2010 22:01:28 -0700 Subject: [PATCH 07/18] Make magit-run* look in the magit-process-buffer for a useful error string when reporting an error, and fall back on the less helpful "Git failed" message only if no error message could be found in the buffer. --- magit.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index 1169aebe..f973ccfd 100644 --- a/magit.el +++ b/magit.el @@ -1640,7 +1640,13 @@ FUNC should leave point at the end of the modified region" (magit-need-refresh magit-process-client-buffer)))) (or successp noerror - (error "Git failed")) + (error + (or (save-excursion + (set-buffer (get-buffer magit-process-buffer-name)) + (when (re-search-backward + (concat "^error: \\(.*\\)" paragraph-separate) nil t) + (match-string 1))) + "Git failed"))) successp))) (autoload 'dired-uncache "dired") From 34025078c56cdf1c0d5f273302959cddc386b73c Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Tue, 21 Sep 2010 10:24:15 +0100 Subject: [PATCH 08/18] Remove extraneous whitespace. --- magit.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index f973ccfd..dc963b67 100644 --- a/magit.el +++ b/magit.el @@ -1640,10 +1640,10 @@ FUNC should leave point at the end of the modified region" (magit-need-refresh magit-process-client-buffer)))) (or successp noerror - (error + (error (or (save-excursion (set-buffer (get-buffer magit-process-buffer-name)) - (when (re-search-backward + (when (re-search-backward (concat "^error: \\(.*\\)" paragraph-separate) nil t) (match-string 1))) "Git failed"))) From 2123b72ec54368d4b6f3096dea13cba8072bf767 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Wed, 22 Sep 2010 14:55:14 +0100 Subject: [PATCH 09/18] Added fetch-other and removed useless fetch option. --- magit-key-mode.el | 6 +++--- magit.el | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/magit-key-mode.el b/magit-key-mode.el index 9e50006b..0571f1a5 100644 --- a/magit-key-mode.el +++ b/magit-key-mode.el @@ -49,9 +49,9 @@ (fetching (man-page "git-fetch") (actions - ("f" "Fetch" magit-fetch)) - (switches - ("-a" "All" "--all"))) + ("f" "Current" magit-fetch-current) + ("a" "All" magit-remote-update) + ("o" "Other" magit-fetch))) (pushing (man-page "git-push") diff --git a/magit.el b/magit.el index dc963b67..e06aeeb0 100644 --- a/magit.el +++ b/magit.el @@ -3080,6 +3080,11 @@ Uncomitted changes in both working tree and staging area are lost. (interactive) (magit-run-git-async "fetch" (magit-read-remote))) +(magit-define-command fetch-current () + "Run fetch." + (interactive) + (magit-run-git-async "fetch")) + (magit-define-command remote-update () "Update all remotes." (interactive) From 96ba81887f6d0818239e69e5626cd512e8ee7731 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Thu, 23 Sep 2010 16:45:25 +0100 Subject: [PATCH 10/18] Fix --committer option. --- magit-key-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magit-key-mode.el b/magit-key-mode.el index 0571f1a5..727d6f75 100644 --- a/magit-key-mode.el +++ b/magit-key-mode.el @@ -34,7 +34,7 @@ ("-al" "All" "--all")) (arguments ("=r" "Relative" "--relative=" read-directory-name) - ("=c" "Committer" "--committer" read-from-minibuffer) + ("=c" "Committer" "--committer=" read-from-minibuffer) ("=>" "Since" "--since=" read-from-minibuffer) ("=<" "Before" "--before=" read-from-minibuffer) ("=s" "Pickaxe search" "-S" read-from-minibuffer) From c6585d534dbd5755cfbb74bc0483d31d1f1955da Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Thu, 23 Sep 2010 22:32:21 +0300 Subject: [PATCH 11/18] iswitchb-based completing-read alternative for rev-reading etc. --- magit.el | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/magit.el b/magit.el index e06aeeb0..cac6d51c 100644 --- a/magit.el +++ b/magit.el @@ -183,6 +183,14 @@ t mean pty, it enable magit to prompt for passphrase when needed." :group 'magit :type 'boolean) +(defcustom magit-completing-read-function 'magit-iswitchb-completing-read + "Function to be called when requesting input from the user." + :group 'magit + :type '(radio (function-item magit-iswitchb-completing-read) + (function-item magit-builtin-completing-read) + (function :tag "Other"))) + + (defface magit-header '((t)) "Face for generic header lines. @@ -327,9 +335,6 @@ Many Magit faces inherit from this one by default." (defvar magit-custom-options '() "List of custom options to pass git. Do not customise this.") -(defvar magit-completing-read 'completing-read - "Function to be called when requesting input from the user.") - (defvar magit-read-rev-history nil "The history of inputs to `magit-read-rev'.") @@ -519,6 +524,30 @@ Many Magit faces inherit from this one by default." (make-variable-buffer-local 'magit-submode) (put 'magit-submode 'permanent-local t) +(defun magit-iswitchb-completing-read (prompt choices &optional predicate require-match + initial-input hist def) + "iswitchb-based completing-read almost-replacement." + (require 'iswitchb) + (let ((iswitchb-make-buflist-hook + (lambda () + (setq iswitchb-temp-buflist (if (consp (first choices)) + (mapcar #'car choices) + choices))))) + (iswitchb-read-buffer (format "%s: " prompt) (or initial-input def) require-match))) + +(defun magit-builtin-completing-read (prompt choices &optional predicate require-match + initial-input hist def) + "Magit wrapper for standard completing-read function." + (completing-read (if def + (format "%s (default %s): " prompt def) + (format "%s: " prompt)) + choices predicate require-match initial-input hist def)) + +(defun magit-completing-read (prompt choices &optional predicate require-match + initial-input hist def) + (funcall magit-completing-read-function prompt choices predicate require-match + initial-input hist def)) + (defun magit-use-region-p () (if (fboundp 'use-region-p) (use-region-p) @@ -686,8 +715,8 @@ Otherwise, return nil." (defun magit-read-top-dir (rawp) (if (and (not rawp) magit-repo-dirs) (let* ((repos (magit-list-repos magit-repo-dirs)) - (reply (funcall magit-completing-read "Git repository: " - (magit-list-repos magit-repo-dirs)))) + (reply (magit-completing-read "Git repository: " + (magit-list-repos magit-repo-dirs)))) (file-name-as-directory (cdr (assoc reply repos)))) (file-name-as-directory @@ -822,8 +851,8 @@ pair (START . END), then the range is START..END.") (format "%s (default %s): " prompt def) (format "%s: " prompt))) (interesting-refs (magit-list-interesting-refs)) - (reply (funcall magit-completing-read prompt interesting-refs - nil nil nil 'magit-read-rev-history def)) + (reply (magit-completing-read prompt interesting-refs nil nil nil + 'magit-read-rev-history def)) (rev (or (cdr (assoc reply interesting-refs)) reply))) (if (string= rev "") nil @@ -887,12 +916,9 @@ PROMPT is used as the prompt, and defaults to \"Remote\". DEF is the default value, and defaults to the value of `magit-get-current-branch'." (let* ((prompt (or prompt "Remote")) (def (or def (magit-get-current-remote))) - (prompt (if def - (format "%s (default %s): " prompt def) - (format "%s: " prompt))) (remotes (magit-git-lines "remote")) - (reply (funcall magit-completing-read prompt remotes - nil nil nil nil def))) + (reply (magit-completing-read prompt remotes + nil nil nil nil def))) (if (string= reply "") nil reply))) ;;; Sections From adce2cbfc306144d75b9c48f46c983ece5246eee Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Thu, 23 Sep 2010 22:34:13 +0300 Subject: [PATCH 12/18] Smarter prompting for magit-checkout Don't offer the current branch as a choice. --- magit.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index cac6d51c..6ade132b 100644 --- a/magit.el +++ b/magit.el @@ -2835,7 +2835,16 @@ rev... maybe." Fails if working tree or staging area contain uncommitted changes. If REVISION is a remote branch, offer to create a local tracking branch. \('git checkout [-b] REVISION')." - (interactive (list (magit-read-rev "Switch to" (magit-default-rev)))) + (interactive + (list (let ((current-branch (magit-get-current-branch)) + (default (magit-default-rev))) + (magit-read-rev "Switch to" + (unless (string= current-branch default) + default) + (if current-branch + (cons (concat "refs/heads/" current-branch) + magit-uninteresting-refs) + magit-uninteresting-refs))))) (if revision (when (not (magit-maybe-create-local-tracking-branch revision)) (magit-save-some-buffers) From 50156dedc15ddc4b0c769fb2579353364be245ce Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Thu, 23 Sep 2010 22:33:26 +0300 Subject: [PATCH 13/18] magit-read-rev: add mechanism to mask uninteresting refs --- magit.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/magit.el b/magit.el index 6ade132b..f72e1ef2 100644 --- a/magit.el +++ b/magit.el @@ -819,12 +819,14 @@ working directory state (or HEAD in a log buffer). If it's a pair (START . END), then the range is START..END.") (make-variable-buffer-local 'magit-current-range) -(defun magit-list-interesting-refs () +(defun magit-list-interesting-refs (&optional uninteresting) (let ((refs ())) (dolist (line (magit-git-lines "show-ref")) (if (string-match "[^ ]+ +\\(.*\\)" line) (let ((ref (match-string 1 line))) - (cond ((string-match "refs/heads/\\(.*\\)" ref) + (cond ((loop for i in uninteresting + thereis (string-match i ref))) + ((string-match "refs/heads/\\(.*\\)" ref) (let ((branch (match-string 1 ref))) (push (cons branch branch) refs))) ((string-match "refs/tags/\\(.*\\)" ref) @@ -844,13 +846,16 @@ pair (START . END), then the range is START..END.") (match-string 2 ref))) ref) refs)))))) - refs)) + (nreverse refs))) -(defun magit-read-rev (prompt &optional def) - (let* ((prompt (if def - (format "%s (default %s): " prompt def) - (format "%s: " prompt))) - (interesting-refs (magit-list-interesting-refs)) +(defvar magit-uninteresting-refs '("refs/remotes/\\([^/]+\\)/HEAD$")) + +;; TODO: fix this so that def can (must?) be git rev instead of, say, "master (origin)" +;; which involves a particular display strategy and shouldn't be visible to callers +;; of magit-read-rev +(defun magit-read-rev (prompt &optional def uninteresting) + (let* ((interesting-refs (magit-list-interesting-refs + (or uninteresting magit-uninteresting-refs))) (reply (magit-completing-read prompt interesting-refs nil nil nil 'magit-read-rev-history def)) (rev (or (cdr (assoc reply interesting-refs)) reply))) From 54745433e2ff7bbd140b8fbafde578ac202af440 Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Thu, 23 Sep 2010 22:34:43 +0300 Subject: [PATCH 14/18] Smarter prompting for magit-rebase-step start Use the tracked branch as the default, if available. Don't offer the current branch as a new base. --- magit.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index f72e1ef2..37889264 100644 --- a/magit.el +++ b/magit.el @@ -2937,7 +2937,20 @@ if any." (interactive) (let ((info (magit-rebase-info))) (if (not info) - (let ((rev (magit-read-rev "Rebase to" (magit-guess-branch)))) + (let* ((current-branch (magit-get-current-branch)) + (remote (when current-branch + (magit-get "branch" current-branch "remote"))) + (remote-branch (when remote + (magit-get "branch" current-branch "merge"))) + (rev (magit-read-rev "Rebase to" + (when (and remote-branch + (string-match "refs/heads/\\(.*\\)" remote-branch)) + (concat (match-string 1 remote-branch) + " (" remote ")")) + (if current-branch + (cons (concat "refs/heads/" current-branch) + magit-uninteresting-refs) + magit-uninteresting-refs)))) (if rev (magit-run-git "rebase" (magit-rev-to-git rev)))) (let ((cursor-in-echo-area t) From 814ba6c71535d531a8fc7d23a9685806b11c0baf Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Sat, 25 Sep 2010 02:21:02 +0300 Subject: [PATCH 15/18] Fix magit-completing-read prompting. Prompts are now fed to magit-completing-read in a form that makes them look ok if magit-completing-read-function is set directly to completing-read or a compatible function instead of a Magit-specific wrapper. --- magit.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/magit.el b/magit.el index 37889264..f7dafdfa 100644 --- a/magit.el +++ b/magit.el @@ -533,14 +533,15 @@ Many Magit faces inherit from this one by default." (setq iswitchb-temp-buflist (if (consp (first choices)) (mapcar #'car choices) choices))))) - (iswitchb-read-buffer (format "%s: " prompt) (or initial-input def) require-match))) + (iswitchb-read-buffer prompt (or initial-input def) require-match))) (defun magit-builtin-completing-read (prompt choices &optional predicate require-match initial-input hist def) "Magit wrapper for standard completing-read function." - (completing-read (if def - (format "%s (default %s): " prompt def) - (format "%s: " prompt)) + (completing-read (if (and def (> (length prompt) 2) + (string-equal ": " (substring prompt -2))) + (format "%s (default %s): " (substring prompt 0 -2) def) + prompt) choices predicate require-match initial-input hist def)) (defun magit-completing-read (prompt choices &optional predicate require-match @@ -856,8 +857,8 @@ pair (START . END), then the range is START..END.") (defun magit-read-rev (prompt &optional def uninteresting) (let* ((interesting-refs (magit-list-interesting-refs (or uninteresting magit-uninteresting-refs))) - (reply (magit-completing-read prompt interesting-refs nil nil nil - 'magit-read-rev-history def)) + (reply (magit-completing-read (concat prompt ": ") interesting-refs + nil nil nil 'magit-read-rev-history def)) (rev (or (cdr (assoc reply interesting-refs)) reply))) (if (string= rev "") nil @@ -919,7 +920,7 @@ pair (START . END), then the range is START..END.") "Read the name of a remote. PROMPT is used as the prompt, and defaults to \"Remote\". DEF is the default value, and defaults to the value of `magit-get-current-branch'." - (let* ((prompt (or prompt "Remote")) + (let* ((prompt (or prompt "Remote: ")) (def (or def (magit-get-current-remote))) (remotes (magit-git-lines "remote")) (reply (magit-completing-read prompt remotes @@ -3190,7 +3191,7 @@ typing and automatically refreshes the status buffer." (branch-remote (magit-get-remote branch)) (push-remote (if (or current-prefix-arg (not branch-remote)) - (magit-read-remote (format "Push %s to" branch) + (magit-read-remote (format "Push %s to: " branch) branch-remote) branch-remote)) (ref-branch (magit-get "branch" branch "merge"))) From 8d94579f8bf5e5d4d5c8445af68abd8c01c80cd7 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Sat, 25 Sep 2010 16:53:26 +0100 Subject: [PATCH 16/18] Make builtin completing read default again. After a couple of requests for this. --- magit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magit.el b/magit.el index f7dafdfa..fbb1a00a 100644 --- a/magit.el +++ b/magit.el @@ -183,7 +183,7 @@ t mean pty, it enable magit to prompt for passphrase when needed." :group 'magit :type 'boolean) -(defcustom magit-completing-read-function 'magit-iswitchb-completing-read +(defcustom magit-completing-read-function 'magit-builtin-completing-read "Function to be called when requesting input from the user." :group 'magit :type '(radio (function-item magit-iswitchb-completing-read) From 8152961d364d097f9a3c27a8e9507669c25f43e4 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Tue, 28 Sep 2010 17:00:19 +0100 Subject: [PATCH 17/18] Added the ability to push tags. --- magit-key-mode.el | 3 ++- magit.el | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/magit-key-mode.el b/magit-key-mode.el index 727d6f75..dda4e4cd 100644 --- a/magit-key-mode.el +++ b/magit-key-mode.el @@ -56,7 +56,8 @@ (pushing (man-page "git-push") (actions - ("p" "Push" magit-push)) + ("p" "Push" magit-push) + ("t" "Push tags" magit-push-tags)) (switches ("-f" "Force" "--force") ("-d" "Dry run" "-n"))) diff --git a/magit.el b/magit.el index fbb1a00a..d0f98a1d 100644 --- a/magit.el +++ b/magit.el @@ -3184,6 +3184,11 @@ typing and automatically refreshes the status buffer." args) nil nil nil t)))) +(magit-define-command push-tags () + "Push tags." + (interactive) + (magit-run-git-async "push" "--tags")) + (magit-define-command push () (interactive) (let* ((branch (or (magit-get-current-branch) From 65e328c5a8f50f9365a34c63973e3070e30f662b Mon Sep 17 00:00:00 2001 From: Philip Weaver Date: Wed, 29 Sep 2010 02:36:30 -0700 Subject: [PATCH 18/18] in Makefile, fix the way we set emacs load-path When using the native Windows emacs build (not a cygwin build), but a cygwin build of 'make', then make fails because we send unix-style paths using CURDIR to emacs. If instead we use (expand-file-name "."), then emacs does the magic for us. I looked around and found that org-mode's Makefile does exactly this. It seems like the right thing to do. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e5ec9d55..0928bc14 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ VERSION=0.8.2 +EMACS=emacs PREFIX=/usr/local ELS=magit.el magit-svn.el magit-topgit.el magit-key-mode.el ELCS=$(ELS:.el=.elc) @@ -6,9 +7,11 @@ DIST_FILES=$(ELS) Makefile magit.texi README.md magit.spec.in magit-pkg.el.in 50 .PHONY=install +BATCH=$(EMACS) -batch -q -no-site-file -eval \ + "(setq load-path (cons (expand-file-name \".\") load-path))" + %.elc: %.el - emacs --batch --eval "(add-to-list 'load-path \"$(CURDIR)\")" \ - --eval '(byte-compile-file "$<")' + $(BATCH) --eval '(byte-compile-file "$<")' all: $(ELCS) magit.info magit.spec magit-pkg.el