Questions tagged [vc]
The vc tag has no usage guidance.
46
questions
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 ...
0
votes
0
answers
65
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....
0
votes
1
answer
37
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, ...
0
votes
0
answers
78
views
Find project root directory using `vc` when first opening file
Load emacs with emacs -q
Evaluate elisp
(defun u/vc-virtualenv ()
(interactive)
(message "project root dir is %s" (vc-root-dir)))
(add-hook 'find-file-hook 'u/vc-virtualenv)
Open any ...
0
votes
1
answer
33
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 ...
1
vote
0
answers
58
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 ...
0
votes
0
answers
212
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-...
0
votes
1
answer
31
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 ...
1
vote
1
answer
131
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 ...
0
votes
1
answer
65
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 ...
3
votes
2
answers
268
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 ...
0
votes
0
answers
47
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 ...
1
vote
1
answer
226
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
1
vote
0
answers
173
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-...
0
votes
1
answer
91
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 ...
2
votes
1
answer
100
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 ...
1
vote
0
answers
74
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 ...
0
votes
2
answers
174
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.
...
2
votes
1
answer
113
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 ...
3
votes
0
answers
264
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 ...
7
votes
1
answer
962
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 ...
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?
3
votes
1
answer
203
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).
1
vote
2
answers
306
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 ((
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 ...
1
vote
1
answer
45
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 ...
1
vote
1
answer
355
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 ...
4
votes
1
answer
1k
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 ...
0
votes
2
answers
180
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 ...
3
votes
2
answers
347
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 ...
1
vote
3
answers
973
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 ...
1
vote
1
answer
381
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.
...
1
vote
2
answers
785
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 ...
1
vote
1
answer
161
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 - ...
1
vote
2
answers
419
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 ...
2
votes
2
answers
352
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 ...
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 ...
0
votes
2
answers
396
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 ...
1
vote
1
answer
157
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 ...
6
votes
1
answer
244
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 ...
2
votes
2
answers
267
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 ...
4
votes
2
answers
829
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 ...
2
votes
2
answers
351
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, ...
3
votes
0
answers
39
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.
2
votes
1
answer
227
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.
8
votes
3
answers
3k
views
Customize vc-mode appearance in mode-line
I use vc-mode to show information about the current VC state in my mode line, like this:
(setq mode-line-format '(… (vc-mode vc-mode) …))
However, I find the default format of vc-mode pretty verbose....