Questions tagged [diff]

56 questions
22
votes
2 answers

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 the same horizontal alignment.
wizmer
  • 877
  • 1
  • 7
  • 9
14
votes
2 answers

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 revisions are on different branches. I'll happily use…
Matt Ellen
  • 355
  • 1
  • 4
  • 12
11
votes
1 answer

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 in magit-status. I have been looking in the manual…
dr jerry
  • 321
  • 1
  • 7
10
votes
4 answers

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 and I'd prefer not to have that information in…
tmalsburg
  • 2,540
  • 1
  • 14
  • 29
7
votes
1 answer

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 whole hunk, only certain lines and keep other…
Tom
  • 1,190
  • 7
  • 16
7
votes
1 answer

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 -> g) (u -> h)" In each case I'd like to highlight changed…
Clément
  • 3,924
  • 1
  • 22
  • 37
6
votes
1 answer

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 buffer and file and only ask if there are…
Emil Vikström
  • 223
  • 1
  • 6
5
votes
3 answers

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?
Ben Hyde
  • 574
  • 3
  • 9
4
votes
3 answers

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 differences. How can I quickly diff lines like…
Tikhon Jelvis
  • 6,152
  • 2
  • 27
  • 40
3
votes
1 answer

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 edit a commit message (the -v flag provides the…
3
votes
1 answer

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 noticing that something is missing. What I'd like to…
tmalsburg
  • 2,540
  • 1
  • 14
  • 29
3
votes
1 answer

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 =f to this glob, but that doesn’t help. (Same…
Michal Rus
  • 257
  • 1
  • 6
3
votes
1 answer

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 I missed it?
fommil
  • 1,750
  • 11
  • 24
2
votes
2 answers

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 command. What can I use instead?
2
votes
3 answers

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 asterisks (*) at the beginning? I would then…
Evgeny Mikhaylov
  • 179
  • 1
  • 14
1
2 3 4