我希望git
向我显示在两次特定提交之间更改的所有行,包括文件名和每行的行号。我想象输出类似于
file.cpp:20:- void deletedFunction()
file.cpp:20:+ int addedFunction()
Makefile:3:-# removed comment
我想用它通过compile-mode的next-error
命令轻松浏览emacs所做的所有提交更改。因此,第二个:
之后的确切输出可能看起来有所不同,但是filename:line:...
应该在那里。此外,并非所有更改都必须列出,也可以只进行添加或删除操作。
很高兴看到我的评论解决了您的问题:)我说:«我想知道(强制性问题):您对马吉特不满意,为什么?您可以看到差异,导航并单击以转到文件并在行nb处输入。对我来说很好。»
Magit手册位于此处:http://magit.github.io/master/magit.html和代码在github上:https://github.com/magit/magit
完整的简介:http://www.masteringemacs.org/articles/2013/12/06/introduction-magit-emacs-mode-git/
((与往常一样,可用于ELPA:M-x list-packages
)
享受!
ps:我使用的两个配置:
; use ido to switch branches
; https://github.com/bradleywright/emacs-d/blob/master/packages/init-magit.el
(setq magit-completing-read-function 'magit-ido-completing-read)
;; open magit status in same window as current buffer
;; (setq magit-status-buffer-switch-function 'switch-to-buffer)
;; highlight word/letter changes in hunk diffs
(setq magit-diff-refine-hunk t)
我从没使用过magit
(尽管我听说过很多好东西),而且我很少使用git
(我是hg
人),但是所有这些都应适用于受支持的VCS vc
模式。
它不像compilation-mode
那样起作用,但是您可以使用diff-mode
轻松浏览差异。
获取差异缓冲区:
C-x v =
对当前文件进行比较。C-x v D
在目录上进行递归比较。C-x v d
带您进入缓冲区,将所有修改/添加/未跟踪/等。存储库中的文件。您可以使用m
选择它们,然后使用=
来比较所选文件。在差异缓冲区中:
n
转到下一个大块。p
转到上一个大块。N
转到下一个文件。P
转到上一个文件。o
转到当前块的源文件。注意git-gutter:https://github.com/emacsorphanage/git-gutter。它为您提供:git-gutter:next-hunk
和git-gutter:previous-hunk
。