Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
magit
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Debian Emacsen team
magit
Commits
230ab992
Commit
230ab992
authored
Feb 27, 2016
by
Jonas Bernoulli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
magit-diff-buffer-file-popup: new command
parent
2a37ad56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
Documentation/RelNotes/2.5.1.txt
Documentation/RelNotes/2.5.1.txt
+4
-0
lisp/magit-diff.el
lisp/magit-diff.el
+18
-0
lisp/magit.el
lisp/magit.el
+7
-6
No files found.
Documentation/RelNotes/2.5.1.txt
View file @
230ab992
...
...
@@ -7,6 +7,10 @@ Updates since v2.5.0
* Added a cache, which memorizes the values of some function calls for
the duration of a refresh. This cuts the calls to git in half.
* Added new command `magit-diff-buffer-file-popup' intended for use in
file-visiting buffers. It shows the same popup as `magit-diff-popup'
but starts out already limited to the visited file.
* Added new command `magit-push-refspecs', which allows pushing using
one or more comma-separated and refspecs, which are explicitly typed
in the minibuffer.
...
...
lisp/magit-diff.el
View file @
230ab992
...
...
@@ -556,6 +556,24 @@ and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=7847."
(default-value 'magit-diff-arguments))))
(magit-invoke-popup 'magit-diff-popup nil arg)))
(defun magit-diff-buffer-file-popup (arg)
"
Popup
console
for
diff
commans.
This
is
a
variant
of
`
magit-diff-popup
'
which
shows
the
same
popup
but
which
limits
the
diff
to
the
file
being
visited
in
the
current
buffer.
"
(interactive "
P
")
(-if-let (file (magit-file-relative-name))
(let ((magit-diff-arguments
(magit-popup-import-file-args
(-if-let (buffer (magit-mode-get-buffer 'magit-diff-mode))
(with-current-buffer buffer
(nth 2 magit-refresh-args))
(default-value 'magit-diff-arguments))
(list file))))
(magit-invoke-popup 'magit-diff-popup nil arg))
(user-error "
Buffer
isn
't
visiting
a
file
")))
(defun magit-diff-refresh-popup (arg)
"
Popup
console
for
changing
diff
arguments
in
the
current
buffer.
"
(interactive "
P
")
...
...
lisp/magit.el
View file @
230ab992
...
...
@@ -2262,12 +2262,13 @@ the current repository."
(
magit-define-popup
magit-file-popup
"Popup console for Magit commands in file-visiting buffers."
:actions
'
((
?s
"Stage"
magit-stage-file
)
(
?l
"Log"
magit-log-buffer-file
)
(
?c
"Commit"
magit-commit-popup
)
(
?u
"Unstage"
magit-unstage-file
)
(
?b
"Blame"
magit-blame-popup
)
nil
nil
(
?p
"Find blob"
magit-blob-previous
))
:actions
'
((
?s
"Stage"
magit-stage-file
)
(
?d
"Diff"
magit-diff-buffer-file-popup
)
(
?b
"Blame"
magit-blame-popup
)
(
?u
"Unstage"
magit-unstage-file
)
(
?l
"Log"
magit-log-buffer-file
)
(
?p
"Find blob"
magit-blob-previous
)
(
?c
"Commit"
magit-commit-popup
))
:max-action-columns
3
)
(
defvar
magit-file-mode-lighter
""
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment