From 8a37b3c4ab9be1561bfb739f2624af06c7637241 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 10 Jun 2010 21:22:40 -0700 Subject: [PATCH 1/4] Add history for magit-read-rev. --- magit.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index c03ad68d..014f4c47 100644 --- a/magit.el +++ b/magit.el @@ -302,6 +302,9 @@ Many Magit faces inherit from this one by default." (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'.") + (defvar magit-omit-untracked-dir-contents nil "When non-nil magit will only list an untracked directory, not its contents.") @@ -587,7 +590,7 @@ return nil." (format "%s: " prompt))) (interesting-refs (magit-list-interesting-refs)) (reply (funcall magit-completing-read prompt interesting-refs - nil nil nil nil def)) + nil nil nil 'magit-read-rev-history def)) (rev (or (cdr (assoc reply interesting-refs)) reply))) (if (string= rev "") nil From 449bebe7571bd4dc0fda4abcaffc5563d1dbe60c Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Thu, 17 Jun 2010 13:08:17 +0200 Subject: [PATCH 2/4] get true name for directories, that specified by symlinks --- magit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magit.el b/magit.el index c03ad68d..eee0efa5 100644 --- a/magit.el +++ b/magit.el @@ -468,7 +468,7 @@ Many Magit faces inherit from this one by default." dirs)))) (defun magit-get-top-dir (cwd) - (let ((cwd (expand-file-name cwd))) + (let ((cwd (expand-file-name (file-truename cwd)))) (when (file-directory-p cwd) (let* ((default-directory cwd) (cdup (magit-git-string "rev-parse" "--show-cdup"))) From 8bcbcb369e2c4fb047c581e5df3b5a3613b5f371 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 20 Jun 2010 11:45:50 +0200 Subject: [PATCH 3/4] Set 'remote branch' text property in branch view This only works with git versions that prefix remote branches with "remotes/" in the output of "git branch -va". git 1.7 and 1.6.3 do, git 1.5.6.5 does not. --- magit.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index 63f5c1a8..1d7d2e85 100644 --- a/magit.el +++ b/magit.el @@ -4084,7 +4084,8 @@ With prefix force the removal even it it hasn't been merged." ) branch-line) (let ((res (list (cons 'current (match-string 1 branch-line)) - (cons 'branch (match-string 2 branch-line))))) + (cons 'branch (match-string 2 branch-line)) + (cons 'remote (string-match-p "^remotes/" (match-string 2 branch-line)))))) (if (match-string 4 branch-line) (cons (cons 'other-ref (match-string 6 branch-line)) res) (append From 043f4383de30ec20372bbcb5bf818ed489cd6031 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 20 Jun 2010 11:50:14 +0200 Subject: [PATCH 4/4] Remove "remotes/" prefix from remote branch names git cannot find a branch named "remotes/repository/branch" with most (all?) of its commands, e.g. "git branch -d -r ..." or "git merge". --- magit.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index 1d7d2e85..0de0bfcf 100644 --- a/magit.el +++ b/magit.el @@ -4025,7 +4025,12 @@ Return values: (defun magit--branch-name-from-line (line) "Extract the branch name from line LINE of 'git branch' output." - (get-text-property 0 'branch-name line)) + (let ((branch (get-text-property 0 'branch-name line))) + (if (and branch + (get-text-property 0 'remote line) + (string-match-p "^remotes/" branch)) + (substring branch 8) + branch))) (defun magit--branch-name-at-point () "Get the branch name in the line at point."