Skip to main content

Questions tagged [diff]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
48 views

Recommendation on how to track changes to a buffer?

I'm creating a programming language mode, and I use a background server process to parse the buffer and give me syntax highlighting, jump-to-definition, and other features. If the file/buffer is large,...
Rob N's user avatar
  • 701
0 votes
0 answers
12 views

Adding automatic diffstat for last change to magit status buffer

I would like my Magit status buffer to display a diffstat of recent changes at the bottom. Ideally, this would be like the diffstat shown by git pull when the merge.stat option is true—a diffstat ...
Michael Hoffman's user avatar
1 vote
1 answer
27 views

Preserving/correcting outdated saved overlays in edited file via diff?

I want to create overlays and save them to a file to be loaded later: One issue I ran into is that sometimes if I forget to save the overlays, I load overlays whose position is outdated for the ...
daedsidog's user avatar
  • 189
1 vote
1 answer
64 views

Save diff from Magit

Sometimes I want to create a diff file from within Magit and send it to someone else, just like I do with git diff > /tmp/a.diff. Can I do that in Magit?
Yasushi Shoji's user avatar
0 votes
0 answers
55 views

How to setup ediff-merge-files to interactively either save the mergebuffer or abort the merging when calling from the command line

I want to merge the two files $FILE1 and $FILE2 via emacs(client) into a $FILE3 on the command line with a way to abort the merge. I tried emacsclient --eval '(ediff-merge-files "'$FILE1'" &...
halloleo's user avatar
  • 1,405
1 vote
1 answer
169 views

magit slow with large files sitting around

I have six large .ipynb files in a git repo (100mb to 200mb each). They have diffs, but I don't want to check them in yet. The problem is that they seem to be the reason why magit becomes extremely ...
hjs's user avatar
  • 111
0 votes
2 answers
143 views

Is there an Emacs function or package to visually compare two text strings?

Searching on Google, I found this website: https://www.dcode.fr/differences-2-texts. It allows "visually" comparing two text strings at the character level, returning a result like this: ...
Gabriele's user avatar
  • 1,680
0 votes
1 answer
57 views

save-some-buffers diff prevents scrolling

After invoking save-some-buffers, I almost always want to check the diffs with d. But when I do so, I'm not able to do any scrolling in the diff window, nor to change its size, or indeed any window's ...
Eric Auld's user avatar
  • 145
0 votes
1 answer
277 views

.. changed on disk; Really edit the buffer? :: diff

I get asked this and it gives me these options: You want to modify a buffer whose disk file has changed since you last read it in or saved it with this buffer. If you say y to go ahead and modify ...
Jason Hunter's user avatar
0 votes
0 answers
46 views

Getting Magit to Show Word Count Diff

I'm aware that by setting (setq magit-diff-refine-hunk 'all) we can get magit to show the words added/changed: Question: Is there a way to force the display the total number of words added, total ...
George's user avatar
  • 939
1 vote
1 answer
182 views

In Magit, how can I quickly diff changes in the current file since my last own commit?

When collaborating with others, I often need to check what others have changed in a file since I last worked on it. Is there an easy way in magit to do this? I.e. show the diff between my last own ...
tmalsburg's user avatar
  • 2,592
0 votes
1 answer
170 views

MAGIT: easier to read diffs

Is there a way in MAGIT to see diffs as one line instead of two with deletions and additions in one line? It would be much easier to navigate.
Emmanuel Goldstein's user avatar
0 votes
1 answer
35 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,280
4 votes
3 answers
532 views

How can I configure magit to use `diff-so-fancy`, not `magit-delta`?

How can I use diff-so-fancy in magit rather than magit-delta? I'd like to refine diff buffer in Emacs with magit. I found diff-so-fancy and prefer it to delta for several reasons. I installed diff-so-...
Ramiro's user avatar
  • 41
0 votes
0 answers
245 views

Can ediff be used to view an existing diff/patch?

Given an existing patch (for example, git show -c > my.diff; emacs my.diff) Most of the commands that are part of ediff rely on having both source & destination available, or referencing ...
ideasman42's user avatar
  • 9,157
1 vote
1 answer
192 views

How to replace the diff output shown by magit?

Is there a way to switch out magit's diff display with a 3rd party output? I would like to use delta which has syntax highlighting & word-level diffs. Is there a way of integrating 3rd party ...
ideasman42's user avatar
  • 9,157
0 votes
0 answers
34 views

How can I change the ivy defaults for diff?

When I invoke diff I get two ivy prompts. The first one defaults to the current buffer, the second often to some kind of backup. It is quite awkward to navigate from the backup path to any useful ...
xeruf's user avatar
  • 354
2 votes
2 answers
71 views

What can I use instead of `diff-buffers` in Aquamacs?

According to the Emacs manual, “the command M-x diff-buffers compares the contents of two specified buffers”. But Aquamacs (Aquamacs 3.2 GNU Emacs 24.4.51.2, macOS 10.14.4) gives me no match for this ...
Philippe-André Lorin's user avatar
0 votes
1 answer
94 views

Why does vdiff not show differences between these two files?

Linux Mint 20, Emacs 27.2, vdiff -20210426.155 I create two files and want to find the difference between them. M-x vdiff-files Select file1.txt and file2.txt Here is the result: As you can see both ...
a_subscriber's user avatar
  • 4,224
1 vote
2 answers
853 views

Org Mode evaluate diff code block

I'm writing a programming tutorial. In between the prose I have diff code blocks that show exactly what changes are done to the code on each step. To make sure the diffs are correct I'd like to be ...
Tad Lispy's user avatar
  • 133
1 vote
1 answer
426 views

How to apply a hunk of changes in diff to current branch?

I have two branches, let's say branch a and b, I would like to apply some changes from b to a. Note that I use magit-diff to show the differences between the two branches. Then I would like to apply ...
Yanghao Xie's user avatar
0 votes
1 answer
227 views

How to efficiently merge 2 buffers which are partially overlapping?

Problem summary Imagine, you have 2 shopping lists: 1 huge one with hundreds of entries - list A, copied into buffer A 1 containing dozens of entries - list B, copied into buffer B Then: 75% of ...
starquake's user avatar
1 vote
1 answer
34 views

magit-diff jumps to insertion/deletion in already opened window (no overlay)

I have 2 windows open: One is the magit-diff of the current repo, the other is just source codes from that repo. In source codes (the right window), I have a file opened, say "sample.txt". In magit-...
mle0312's user avatar
  • 295
1 vote
0 answers
152 views

Using diff-buffer-with-file to merge differences between the disk and the buffer

I sync my org files via Dropbox. Occasionally, Dropbox will bring in changes into a file whose buffer I've already modified. I can diff the buffer and the file on disk with diff-buffer-with-file; but ...
EightyEight's user avatar
3 votes
1 answer
364 views

How to activate diff-mode from command line?

Git's editor config is set to launch emacs in no-window mode and to execute lisp function diff-mode: git config --global core.editor "emacs -nw -f diff-mode" However, when I execute git commit -v to ...
Bas Peeters's user avatar
1 vote
1 answer
276 views

How to diff against a git branch?

I'm currently using (vc-root-diff nil) however, I'd like to spesify a branch. Calling (vc-root-diff t) prompts for the revision, and the path. Is there a way to diff against a branch without, ...
ideasman42's user avatar
  • 9,157
2 votes
3 answers
148 views

How to make a diff tool ignore asterisks?

I want to compare and merge some org files. How can I make a diff tool assume that some tasks or notes are identical, even if they are on different levels, i.e. strings only differ in the number of ...
Evgeny Mikhaylov's user avatar
0 votes
1 answer
41 views

Show only different symbols. Not entire line [duplicate]

windows 10, dired+ when I compare two files I get this: The different in this file are two words: first second But diff tool show me that is different ENTIRE line. It's not very good. Is it ...
Alex's user avatar
  • 831
-1 votes
2 answers
171 views

What tool can I use to compare files by content in dired mode? [closed]

windows 10 (64 bit) Emacs 26.1, Dired+ I need tool that can compare files by content with highlight different symbols. Example: As you can see I mark two files. Is it possible to compare this ...
Alex's user avatar
  • 831
7 votes
3 answers
1k views

How can I diff two long lines from the same buffer?

When I run tests for my projects, failing tests produce output that looks something like this: expected: "..." but got: "..." The "..." are long lines that often only have small ...
Tikhon Jelvis's user avatar
2 votes
3 answers
258 views

How to open a diff at the position of the current buffer?

Emacs has a useful feature to jump to the line (via diff-goto-source-and-close). Is there a way to do the reverse with vc-root-diff or something similar? That is to open a diff, jumping to the ...
ideasman42's user avatar
  • 9,157
12 votes
1 answer
2k views

How to diff one file against another branch with Magit

I want to see the differences of a file in another branch. With git I can simply do: git diff otherbranch: path-to-file. In magit this seems trickier as the file may not be dirty and not showing up ...
dr jerry's user avatar
  • 331
2 votes
1 answer
1k views

emacs ediff show all buffer diff word-wise (like vimdiff)

Issue description When launching Ediff color scheme is very poor and i do not have word wise diff highlight. It seems that diff color faces are not activated at ediff startup. I use emacs -Q to ...
stockersky's user avatar
0 votes
1 answer
213 views

Magit Tramp not showing diff window

When using magit on a local file, I stage my changes and I then press c and c again to commit. I get a new window showing the diff and a window for the commit message. I write my commit message press ...
user27815's user avatar
  • 249
15 votes
2 answers
14k views

Use magit to display the difference between two branches

Is there a way to bring up a big list of the differences between specific commits across two branches? I tried the method described in this answer but it came back empty, I assume because the ...
Matt Ellen's user avatar
1 vote
1 answer
273 views

How to diff a single, unstaged file in magit-status?

How can I display a diff for the actually selected file in magit-status? What can I do in do display a diff of build/conf/local.conf? With the now deprecated git-status, I could run git-diff-file (...
ensc's user avatar
  • 178
0 votes
1 answer
93 views

magit-diff-visit-file key bindings

While point is inside a diff in a Magit buffer I press RET, which invokes magit-diff-visit-file. After checking this file, I want to quit it and get back to the Magit buffer that was previously ...
McBear Holden'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,280
2 votes
1 answer
226 views

Find the first difference between two buffers

Given two buffers, how do I find the first character position where their contents differ? E.g. for contents abcdef and abcDeF, the first difference would be at point=4. For abc and ab, it would be at ...
Lassi's user avatar
  • 387
0 votes
1 answer
36 views

Rewriting all file when save some changes

I work on Rails project in my Emacs25. When I change one specific file and save changes I got all file changed (from git diff). But when I try to old and new versions of this file in Meld - I get ...
Alexey Moshkin's user avatar
1 vote
1 answer
412 views

Magit magit-diff-refine-hunk does not work if I don't move the cursor to the good lines

In magit, it looks like that if I want to have a diff that highlight changing words, I can either press D t when I'm in the diff, or put in my .emacs (custom-set-variables '(magit-diff-refine-hunk ...
tobiasBora's user avatar
2 votes
1 answer
368 views

Magit diff with --name-only?

I am browsing the differences between two branches of a repository via git diff --name-only branch1 branch2 I also use the --name-status option sometimes, since I may need to see what sort of ...
GDP2's user avatar
  • 1,350
1 vote
1 answer
133 views

Smerge and nested diffs

After screwing around with Magit rebasing, I ended up with a commit that includes a bunch of diff markers in a file[1]: <<<<<<< HEAD ======= foo <<<<<<< ...
Tianxiang Xiong's user avatar
1 vote
1 answer
355 views

How can I use magit to diff some text with my clipboard?

I see others doing this in there IDEs is there a way to highlight a file or some text in a file and diff it with whats in my clipboard/kill-ring ?
Oly's user avatar
  • 593
2 votes
1 answer
864 views

view git diff version by version

I'd like to browse the history of a specific file version by version. Ideally, as I step through history I should compare it with the closest previous version.
m33lky's user avatar
  • 307
0 votes
1 answer
201 views

vdiff-refine-all-hunks/ediff-update-diffs in startup eval

I'm having a problem with putting vdiff-refine-all-hunks or ediff-update-diffs into --eval for startup. Take vdiff as example, I'm calling it using: emacs --eval "(progn (vdiff-files file1 file2) (...
phonycollectibles's user avatar
1 vote
1 answer
425 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
  • 576
25 votes
2 answers
10k views

Magit diff side by side

I would like to know if there is a way to get the standard side by side diff view in magit. That is, instead of seeing the old code chunk and the new one one after the other, I'd like to see them on ...
wizmer's user avatar
  • 947
1 vote
1 answer
181 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
0 answers
345 views

Ignore certain changes in Ediff

I have two versions of a file (or buffer) and I'm running ediff to compare them. Some of the changes are irrelevant and I want to ignore them. Specifically, foo has been renamed to bar in places and I ...
Gilles 'SO- stop being evil''s user avatar