Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Diff between two revisions #15

Closed
krlmlr opened this issue Sep 9, 2016 · 8 comments
Closed

FR: Diff between two revisions #15

krlmlr opened this issue Sep 9, 2016 · 8 comments

Comments

@krlmlr
Copy link
Contributor

krlmlr commented Sep 9, 2016

In the spirit of -c, allowing two commits and showing the differences between them. Maybe -C?

Original issue: https://sourceforge.net/p/diffuse/bugs/5/

@krlmlr
Copy link
Contributor Author

krlmlr commented Oct 24, 2022

@MightyCreak: Thanks for reviving diffuse, I tested on macOS M1 today, works like a charm. Are you open to this? Would you like help?

@MightyCreak
Copy link
Owner

I'm trying to understand exactly what you would like to have, because the original issue talks about -r and -m and you talk about -c and -C, so I'm a bit confused what's the actual behaviour you would like to have ;)

@krlmlr
Copy link
Contributor Author

krlmlr commented Oct 24, 2022

Perhaps something like

diffuse -C sha1 sha2

comparing the two SHAs?

?

@MightyCreak
Copy link
Owner

I see... I think I tried to find something a few months ago, but the issue was that all the VCSs didn't behaved the same. I think it just needs some reflection before implementing it.

@joyously
Copy link

I have an older version of diffuse installed (0.5.0) and the man page says this:

  The default revision of a file will be used for comparison if only one file is specified.
  For example, this will display a 2-way merge between the default revision of foo.C and the
  local foo.C file:

           $ diffuse foo.C

Specifying Revisions
  The -r option may also be used to explicitly specify a particular file revision. Any
  revision specifier understood by the version control system may be used. The local file
  will be used for comparison if only one file revision is specified. For example, this will
  display a 2-way merge between revision 123 of foo.C and the local foo.C file:

       $ diffuse -r 123 foo.C

  Multiple file revisions can be compared by specifying multiple -r options. For example,
  this will display a 2-way merge between revision 123 of foo.C and revision 321 of foo.C:

       $ diffuse -r 123 -r 321 foo.C

  Local files can be mixed with files from the version control system. For example, this
  will display a 3-way merge between revision MERGE_HEAD of foo.C, the local foo.C file,
  and revision HEAD of foo.C:

       $ diffuse -r MERGE_HEAD foo.C foo.C -r HEAD foo.C

  For the -c option may be used to easily specify a pair of sequential revisions. For
  example, this will display a 2-way merge between revision 1.2.2 of foo.C and revision
  1.2.3 of foo.C:

       $ diffuse -c 1.2.3 foo.C

@hugoholgersson
Copy link
Contributor

Good catch @joyously, diffuse -r commitA -r commitB FILE does the job here so I think we can close this issue. I've tested it on macOS, Fedora and Flatpak now.

I didn't know of -r myself because I've always used git difftool. Using -r is probably friendlier in many cases (no need to set TMPDIR for Flatpak). I my work however, I've already made other scripts that calls git difftool.

How to use Diffuse as git difftool:

git config diff.tool "diffuse"
git difftool --no-prompt commitA commitB -- FILE & 

This works on Fedora and on macOS.

Flatpak

If you run from Flatpak, you must create a wrapper command, with the name diffuse, for git to use, i.e a diffuse command in git's PATH, for example like this:

#!/bin/bash
#
# This is diffuse's command-line entry point, compatible with "git difftool".
#
flatpak run --user io.github.mightycreak.Diffuse $@

You also need to set TMPDIR to something in ~ otherwise gitcreates temp files in /tmp by default and our Flatpak instance can't read files outside /home.

export TMPDIR=~/tmp 

(I just learned to use Flatpak this week when I needed to install diffuse on a remote CentOS machine).

@krlmlr
Copy link
Contributor Author

krlmlr commented May 15, 2023

I'll try, thanks!

@krlmlr krlmlr closed this as completed May 15, 2023
@Ansa211
Copy link

Ansa211 commented May 16, 2023

@krlmlr Is this really completed? I still think that the -r option can only be used with a specific file while this issue was about opening all files with differences between the two commits... I am wondering whether I should reopen #190 because I've assumed it was a duplicate of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants