Skip to main content
6 votes

Make VC log history to follow file renames

This is possible in Emacs 26.1. You need to set the configuration variable vc-git-print-log-follow to t. The functionality was implemented in the following commit:
Peter Osterlund's user avatar
5 votes

Version control information out of sync with certain modes

When using diff-hl and magit => v2.4.0 you have to add this: (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) As far as the information in the mode-line is concerned, I would ...
tarsius's user avatar
  • 25.8k
5 votes

Disabling automatic add after resolving git conflict

This behaviour is controlled by the vc-git-resolve-conflicts variable. Setting this to nil removes automatic git-add after conflict resolution.
miffo's user avatar
  • 101
4 votes

Find a version controlled project's root?

Wrong number of arguments vc-find-root must be invoked with two arguments: (vc-find-root FILE WITNESS). To get vc root use vc-root-dir instead: vc-root-dir is an autoloaded compiled Lisp function in ...
muffinmad's user avatar
  • 2,320
3 votes

vc-mode doesn't evaluate when mode-line-format is set with setq-default

When the code in your init file runs, there are no open files at all. vc-mode is only set when a file is finally opened and determined to be in version–controlled. This means that when it runs your ...
db48x's user avatar
  • 18.4k
2 votes

Version control: how to inhibit opening email buffer upon breaking lock

I figured it out. Following method 2 outlined in this answer, I just redefined the function vc-steal-lock by commenting out the chunk of code that has to do with emailing the person from whom you ...
MTS's user avatar
  • 377
2 votes

Is there a way to see a log of the backend commands issued by VC commands?

C-hv vc-post-command-functions will probably get you the majority of them, but not necessarily all of them. For instance, I note that vc-git.el uses its own internal vc-git--call for a handful of ...
phils's user avatar
  • 51.7k
2 votes

Lags when navigating vc-root-diff buffer

I already had an issue with hunk refinement, that fixed by: ;; Since 27.1 it is enabled during font-lock. Need to disable explicitly. (setq diff-refine nil) So I checked /usr/share/emacs/27.1/lisp/vc/...
gavenkoa's user avatar
  • 3,462
2 votes

*vc-dir* show ignored files

I finally came around to solving this problem. The following code uses ‘vc-exec-after’ to be compatible with Emacs 23.x. With the customizable command ‘vcx-dir-hide-states’, mapped to ‘X’ in *vc-dir* ...
wolfmanx's user avatar
  • 131
2 votes

Emacs doesn't recognize if file is under version control

The VC packages uses caching, and in many places assumes that the user interacts with VCS systems (e.g. Git) through it. To register a new file in a Git repository, press C-x v v, you don't need to ...
Dmitry's user avatar
  • 3,803
1 vote

Emacs doesn't recognize if file is under version control

Use C-x C-v (find-alternate-file) to reload bar.txt. You should then see "Git@master" in the mode line.
stevoooo's user avatar
  • 747
1 vote

Determine if a directory is .gitignored with vc

I'm afraid there is no such API in vc-mode or magit, but with little elisp you can implement all by yourself: (defun my/is-git-ignored (file) (interactive "fFile:") (not (string-empty-p ...
Jiacai Liu's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible