Questions tagged [vc]

`vc.el` is a generic version control interface that comes with Emacs. It supports Git, CVS, RCS, SRC, GNU Subversion, Bzr, Mercurial, Monotone and SCCS (CSSC)

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

What is the equivalent of doing `git reset <file>` / `git reset` with the shipped vc?

I sometimes want to unstage changes. From the console I can use git reset or git reset <file>. I couldn't find anything related in the docs or via C-x v C-h for vc, but it seems that this should ...
grszkthfr's user avatar
0 votes
1 answer
22 views

Tramp not reusing connections for Git commands

I am debugging a very slow performance of git commands over SSH, including via packages such as VC and Magit. Even using VC on emacs -Q is extremely slow. I get Tramp: Opening connection git for <&...
Arthur Colombini Gusmão's user avatar
0 votes
0 answers
53 views

Handling password input with shell-command or vc-git-push for ssh keys

I'm trying to automate pushing to a git remote, let's say with code that looks like this: (defun my-git-push (repo) (let ((default-directory repo)) (vc-git-push nil))) I get this error: ...
thanosapollo's user avatar
2 votes
2 answers
59 views

Cannot commit parts of *vc-diff* on Microsoft Windows

Emacs has a beautiful feature: in the *vc-diff* buffer (generated by vc-diff either by C-x v = in a file buffer or by = in a *vc-dir* buffer), kill unwanted hunks with k (i.e., diff-hunk-kill) and ...
sds's user avatar
  • 6,114
0 votes
0 answers
8 views

Cannot make vc-style wrapping of git commit to work

None of these functions currently perform works as I except: (defun vc-git-commit () "Commit (via git)." (interactive) (vc-git--run-command-string nil "commit") (vc-dir-...
Nordlöw's user avatar
  • 507
0 votes
0 answers
10 views

Prevent `vc-dir` from showing untracked directories recursively

Is there a setting to prevent vc-dir from showing untracked directories recursively and instead only show the directory as untracked? The former alternative is way to slow and should IMO be the ...
Nordlöw's user avatar
  • 507
0 votes
0 answers
19 views

Run a command after vc-git-log-outgoing

I'm trying to fix a problem with this project: https://github.com/domtronn/spaceline-all-the-icons.el Specifically this code which is supposed to count the number of commits ahead of another branch ...
Cameron Ball's user avatar
0 votes
0 answers
109 views

Emacs 28.2 VC-git crashes on Mac Studio Ventura

I migrated from a trashcan Intel MacPro running macOS Monterey to a MacStudio running Ventura. I installed Emacs from https://emacsformacosx.com/, version 28.2. On the Intel MacPro I am using Emacs 26....
ovidiu's user avatar
  • 101
0 votes
1 answer
89 views

prevent symbolic link follow from git repo HOWTO

I have git repo here: ~/git/myrepo/ then I do: ln -s ~/external_dir ~/git/myrepo emacs follows symbolic link when opening the file: ~/git/myrepo/external_dir/somefile.txt I'd like to prevent it, ...
vibrys's user avatar
  • 21
0 votes
1 answer
41 views

Change vc-print-log split axis

I recently updated to emacs 28.2 (as packaged from https://emacsformacosx.com/). Prior to this if I hit C-x v l (vc-print-log) to see a file's git history, the window split horizontally. I'd have the ...
Doug Harris's user avatar
1 vote
0 answers
94 views

Potential reason why vc-annotate output is sometimes incomplete?

On Emacs 27.1 running on Linux, with Subversion backend, vc-annotate does not always annotate the complete file (seen on 3000-lines, 110KB text file). The vc-annotate-mode buffer holds the beginning ...
PRouleau's user avatar
  • 796
0 votes
0 answers
295 views

Run pre-commit hooks when using magit, poetry, and tramp

This is an emacs & magit version of the following question, with an added twist. https://stackoverflow.com/questions/72839263/access-python-interpreter-in-vscode-version-controll-when-using-pre-...
q.undertow's user avatar
0 votes
1 answer
32 views

How can I run a function when vc-diff finishes?

The diff command can be async, of course. Is there an easy way to run a function when the async or sync diff command finished running and the diff buffer's contents is ready? I checked, but I saw no ...
Tom's user avatar
  • 1,260
1 vote
1 answer
137 views

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

I'd like to see the what commands are issued by the child process used by the various VC commands. Is there a way to log them or collect them without modifying the VC code? For example, I'd like to ...
PRouleau's user avatar
  • 796
0 votes
1 answer
72 views

Can Emacs be set to auto-stage (preferably with --intent-to-add) new files?

I often add a new file to a repo, make some other changes, then stage all, and commit all, forgetting that the new file is not yet tracked, so is not included in the stage all step. At least one ...
Tom Dalziel's user avatar
3 votes
2 answers
377 views

How to query the name of the current branch in an elisp function?

I'd like to know the current branch I'm in (in elisp), is there a generic function that returns the name of the current branch? From looking into vc-mode mode-line logic it seems this relies on ...
ideasman42's user avatar
  • 8,806
0 votes
1 answer
61 views

vc-annotate: strip the last character of git commit id

When editing a file managed by Git, vc-annotate shows the output of git blame. As Git usually does, revisions are identified by a short commit id. The short commit id is abbreviated to be one ...
Gilles 'SO- stop being evil''s user avatar
1 vote
1 answer
292 views

How to sign git commit using VC?

I am just wondering how can VC can be used to sign commit using gpg, Currently I am using vc without sign mean I am using vc-next-action to perform git commit
nerding_it's user avatar
1 vote
0 answers
187 views

Cannot figure out why vc-git.elc is always loaded on startup

This is more a curiosity, than a necessity. I'm playing around with startup times, and to have something to compare with, I wanted to see how fast emacs could start up pure. Running emacs -Q, emacs-...
Ole's user avatar
  • 141
0 votes
1 answer
113 views

Version control: registered or unregistered?

I'm a bit confused when writing code using the VC interface. After executing the following commands in the shell (committing a dummy file ~/test/file in a fresh git repo ~/test): cd mkdir test cd ...
Firmin Martin's user avatar
2 votes
1 answer
103 views

How to resolve TRAMP spamming empty messages

Connecting to a remote machine with tramp that may have VC (subversion) related files, I tend to see a large number of repeated messages in the *Messages* buffer. For example: Type "q" in help ...
kballou's user avatar
  • 125
1 vote
0 answers
89 views

Git status on modeline to indicate if behind remote?

Can I get Emacs to indicate on the mode-line whether a push is needed, i.e. whether the repo is out of sync with origin? I've already got it telling me if a commit is needed using vc-status, but that ...
Vultan's user avatar
  • 121
0 votes
2 answers
192 views

Can't enable a file in Version Control RCS in Emacs 26

Trying here to set a file with VC RCS, but I'm having some trouble finding the .el file and enable it. Already managed to download rcs.el from this link, but it isn't being recognized in Emacs. ...
Baraujo85's user avatar
  • 125
2 votes
1 answer
118 views

Disable VC for SVN in exclusive-locking mode

I have Subversion exclusive-locking enabled to increase SVN performance. If I commit a file the svn command line client opens Emacs so I can enter a commit message. But Emacs VC tries to determine the ...
holger's user avatar
  • 23
3 votes
0 answers
292 views

Is there a more async or lazy vc-mode?

Question Does a "lazy" or "asynchronous" vc mode exist? Background Emacs vc mode is designed on the assumption that the version control backend is fast. Much of the core vc features wants the ...
MattArmstrong's user avatar
7 votes
1 answer
1k views

Is there a way to revert only certain lines from a diff hunk?

I use the builtin VC package and it's very nice that when I do a diff of changes in the current file then I can revert any hunk in the diff quickly with C-a But sometimes I don't want to revert the ...
Tom's user avatar
  • 1,260
6 votes
1 answer
2k views

How do I visit a file on a different branch?

I'm aware of C-x v ~ which allows you to see a different revision of the current file, but I would like to visit the file on another branch. Is this possible with magit, VC or git-timemachine?
alecvn's user avatar
  • 419
3 votes
1 answer
214 views

Make VC log history to follow file renames

I like to see full file history regardless file renames (and with Java convention class name == file name several refactoring makes following history difficult).
gavenkoa's user avatar
  • 3,452
1 vote
2 answers
359 views

How can I see diff for specific changeset?

I want an analog of git show $REV / hg diff -c $REV / svn diff -c $REV in Emacs when I know $REV. Currently I open full history via C-x v L and search for specific revision and then type d or l ((
gavenkoa's user avatar
  • 3,452
1 vote
0 answers
29 views

Possible to make vc-dir aware of (hg) subrepo changes?

vc-dir works really well for most of my needs, as I use both hg and svn repositories. But most of the hg repos I work with have subrepositories. I typically use vc-dir buffers for each of the subrepos ...
ned_zeppelin's user avatar
1 vote
1 answer
49 views

How to prevent the creation of an RCS directory?

When I enable version control for a certain file using RCS, Emacs 27.0.50 creates an RCS subdirectory. I remember that some former versions of Emacs just created a …,v sidecar file instead. How can ...
Torsten Bronger's user avatar
1 vote
1 answer
372 views

Resolve git merge conflict by applying diff hunk to different file

I have refactored a file by splitting into two files in one git branch, and someone else has made a different change to the original file on another git branch. This has produced a merge conflict in ...
Robin Green's user avatar
4 votes
1 answer
2k views

How do I do a `git add` with vc-git?

I want to stage a file or a hunk using vc-git (the vc system that comes with Emacs). How do I do this? (To clarify, I made modifications on a file that is already (registered) in git. I would like to ...
Debajit's user avatar
  • 288
0 votes
2 answers
181 views

Is there a common way to open "svn-status" or "magit" depending on current buffers system?

before I sit down and reinvent the wheel for me: I'm working with svn and git in different projects. Is there already an existing way to start svn-status or magit, depending on the vcs that is used ...
Markus's user avatar
  • 481
3 votes
2 answers
384 views

VC status behavior in ibuffer-vc

I use ibuffer-vc, a replacement for list-buffer that displays the VC status of the listed files. I noted that the VC status stays as "edited" even after I push my changes. That is, the VC status does ...
falsum's user avatar
  • 145
2 votes
3 answers
1k views

Emacs doesn't recognize if file is under version control

I noticed I never see in the mode line in which VCS branch I'm currently in, when I open a file in Emacs. So I tried it with an empty Emacs, created a folder in Eshell, called ~/foo , and initialized ...
ReneFroger's user avatar
  • 3,880
1 vote
1 answer
402 views

diff-refine-hunk with unified diff

Problem Some versions of diff (notably, busybox diff in every build of BusyBox I've seen) only produce "unified" diff format output, they don't produce the output that GNU diff produces by default. ...
mtraceur's user avatar
  • 346
1 vote
2 answers
840 views

vc-git doesn't recognize that file is under version control

I initialized a Git repository outside emacs, added and committed the files. Now if I a file in emacs that is under version control by Git and run C-x v = emacs tells me This file is not under ...
BMBM's user avatar
  • 361
1 vote
1 answer
167 views

Ignoring newline changes in smerge-diff-mine-other

For me, smerge-diff-mine-other seems to ignore changes in the number of whitespace characters where there is whitespace, but I would sometimes like it to ignore all whitespace, including newlines - ...
Robin Green's user avatar
1 vote
2 answers
455 views

super detailed vc-change-log

When I do l (vc-print-log) in the *vc-dir* buffer, I get the *vc-change-log* buffer with a single line per commit. Even when I can hit RET (log-view-toggle-entry-display) there to get the details, I ...
sds's user avatar
  • 6,114
2 votes
2 answers
389 views

Discarding modified hunk at current position

I'd like to discard modified hunks (and ideally, view the diff before) basing on the current buffer position. I have diff-hl so that it's quite obvious which part of a buffer are modified. Now, how ...
adamw's user avatar
  • 123
3 votes
1 answer
72 views

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

My work uses GNU RCS for our version control system, but I don't think the specific VCS is relevant here. (I know RCS isn't the most modern system but it suits our needs fine and has the advantage of ...
MTS's user avatar
  • 377
0 votes
2 answers
424 views

On occasion, mode-line git information gets stuck and doesn't update

On occasion, the git information on mode-line, gets stuck and will not update. For example if I checkout to a different branch, the old branch will still be shown. Or the "mod" indicator will remain ...
unskilledidiot's user avatar
1 vote
1 answer
167 views

Ignore multiple files in VC mode

In VC Directory Mode, how do I ignore multiple files? My use case is that I have a LaTeX repository (in SVN, but that should not matter) with over 15 *.aux files in a subdirectory. Attempt 1 Mark a ...
Wouter Beek's user avatar
7 votes
1 answer
268 views

Indicate whether file has uncommited changes in mode line

In my mode line I can see if a buffer has unsaved changes (**- or a red x in my case, since I am using smart-mode-line). Is there a similar way to display whether or not the file visited by the ...
elethan's user avatar
  • 4,825
2 votes
2 answers
285 views

Show change log of other branch with vc-git

When using VC for a Git repository on Emacs 24.3, I want to view commits in a different branch from the one I've checked out. It seems like C-u C-x v l should be command for that, as it asks Log from ...
legoscia's user avatar
  • 6,072
5 votes
2 answers
880 views

How to change options passed to git vc-annotate?

I have a hard time using vc-annotate (my version control system is git), because the output is not very userfriendly, as it displays long filenames in a separate column in the buffer, which take up ...
BMBM's user avatar
  • 361
2 votes
2 answers
365 views

How to "svn revert <file>" with Emacs Version Control?

How can I do a svn revert <file> from Emacs Version Control? I've read many parts of the manual, but can't find it. I would like to do it over a file after opening it with vc-directory C-x v d, ...
nephewtom's user avatar
  • 2,261
4 votes
1 answer
57 views

Determine if a directory is .gitignored with vc

I would like to determine if the current directory/file is ignored by .gitignore with vc. In this case, only git matters, but of course a general solution would be appreciated.
PythonNut's user avatar
  • 10.4k
2 votes
1 answer
233 views

Both VC and Magit cannot see global .gitignore

I'm using emacs on Windows and this is long bothered me. All other apps correctly ignore all listed in global .gitignore, but in emacs they are untracked/unregistered and pollute the status window.
nii's user avatar
  • 49