Questions tagged [diff]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 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, ...
2
votes
3answers
64 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 ...
0
votes
1answer
16 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 ...
-1
votes
2answers
34 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 ...
2
votes
3answers
95 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 ...
2
votes
3answers
128 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 ...
4
votes
1answer
163 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 ...
1
vote
1answer
195 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 ...
0
votes
0answers
26 views

Is diff syntax recognized as a valid org babel src block type?

How can I get syntax coloring after exporting when when the contents of my org babel src block is diff style: #+BEGIN_SRC diff <--- is that even a valid keyword diff --git a/railties/lib/rails/...
0
votes
1answer
54 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 ...
2
votes
1answer
992 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 ...
1
vote
1answer
174 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 (...
0
votes
1answer
44 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 ...
5
votes
1answer
177 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 ...
2
votes
1answer
92 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 ...
0
votes
1answer
24 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 ...
0
votes
1answer
202 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 ...
1
vote
1answer
145 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 ...
1
vote
1answer
113 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 <<<<<<< ...
1
vote
1answer
140 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 ?
1
vote
1answer
542 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.
0
votes
1answer
104 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) (...
1
vote
1answer
212 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. ...
10
votes
1answer
4k 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 ...
1
vote
1answer
105 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
0answers
140 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 ...
8
votes
4answers
775 views

Diff of two buffers without creating temporary files

I need the diff of two buffers. One way would be to create temporary files containing the contents of these buffers and to use the diff function. However, the buffers contain sensitive information ...
1
vote
1answer
217 views

Automatically show diff before saving file

I have a file that contains important information and I often have to make small changes in this file. Every once in a while I accidentally change something in this file and then save it without ...
1
vote
0answers
53 views

C++ source highlight in Diff mode

I'd like to know if Emacs has an option to highlight the portions of C++ source inside .diff files generated by e.g. git diff HEAD~1 or git log -p Right now I have to rename my .diff file to ...
3
votes
1answer
100 views

Running diff in Magit, filtered to only some specific files

I’m basically trying to run this command, but in Magit: git diff master..17 -- "**/*.scala" … i.e. to view changes in all *.scala files between ref/heads/master and ref/heads/17. I’ve tried setting ...
5
votes
1answer
213 views

Make Emacs diff files before asking to save

When I run save-buffers-kill-emacs or projectile-kill-buffers I get asked to save changed buffers. But for me a lot of these buffers do not differ from the file on disk. Can I make Emacs diff the ...
2
votes
0answers
93 views

emacs-show-diff-output produces empty buffer

EDIT: I figured it out. It seems to be an emacs bug. My walk-through of the bug is below. I just now found out about emacs-show-diff-output, which is bound to D by default in an ediff session. When ...
0
votes
1answer
237 views

diff marked files in Dired+

If I have marked a couple files in different directories using Dired+ is there a way to see the diff? I was looking at dired-diff and diredp-diff, but they both take the file at point. Granted that ...
2
votes
2answers
369 views

how to properly capture `diff` output in buffer (without first opening a file)?

summary If one captures diff output to a file name=*.diff and opens that file in a buffer, one gets nicely-formatted mode=Diff. How to get that directly, without first capturing to a file? details ...
7
votes
1answer
190 views

Lightweight (pure elisp) diffs?

I need to display word-diffs of a number of small strings. That is, I have a list of pairs similar to the following: "aaa bbb ccc" . "aaa vv ccc" "abcd ef ghkl" . "ghkl" "a (u -> h)" . "(a -> ...
3
votes
1answer
215 views

apply full diff in Diff-Mode?

Emacs has a really nice mode for applying and navigating hunks of a diff file: Diff-Mode However, there doesn't seem to be a way to apply the full diff when in this mode. Is this just so obvious that ...
2
votes
1answer
143 views

How do I spell check directly from the magit-status buffer

Question: Is it possible to run ispell on a region (or the whole diff and nothing else) directly from the magit-status buffer? Motivation: I am writing varying amounts of text and often keep it ...
5
votes
3answers
2k views

How do I check if two regions have identical content?

How do i check if two regions have identical content? Is it possible to do so while ignoring language-specific whitespace?