If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

GIT branch-to-branch comparison (ala Subversion Profile)

11-Aug-2016, 11:15 AM

I've been a BeyondCompare addict since 1.0 and have over time gone through MANY* different version control systems. These days, I find myself doing most of my work in Git (and GitHub). Since Git is so branch happy, I often find myself pulling multiple copies of a repository into distinct directories and doing a git checkout of the appropriate branch, then doing a BeyondCompare Folder Comparison.

This is annoying in two ways... firstly the need to have TWO copies of the .git metadate/blob folder is disk-expensive, secondly the need to explicitly check out a specific branch and all the git-churn that requires.

What I would LOVE is the ability to set a Source Profile (using similar interface to the Subversion Profile) that lets me specify the repository (usually a local directory, but no reason it can't be a remote https:-protocol git URL) and select a branch/tag/SHA. Then, especially when running against a local .git repository, we would not even need to checkout the files as Git is very good at telling us what the differences actually are... but getting my (well loved!) BeyondCompare interface on top would RULE.

Git supports a --dir-diff variable that can be used to perform folder level comparisons. I believe this still generates local files for us to view, but it would handle many of the steps automatically. Here is a reference forum post and blog post link on the setup:https://secure.scootersoftware.com/v...Using-with-git

Update: And I should add, we're always on the look out for additional Profile types. It would have to be a specific "Git" profile, as seen with Subversion, most source control does not support generically connecting to it remotely.

Obviously, the pie-in-the-sky hope would be to avoid having to do more than clone the meta-data down... e.g. not doing the check-out at all, but no idea how the Subversion Profile works, so not sure that's possible... I could implement this as a first-step if I had an example of how to write a Profile provider...

Comment

I've been using git difftool --dir-diff with beyond compare for a while. With the latest updates of git and beyond compare, however, I can't compare two branches anymore.

git difftool --d <branch1>, used to compare current branch to <branch1> opens beyond compare with no files on the left side.
git difftool --d <branch1> <branch2>, where none of the branches is the current one, seems to work.

Is updating Git to test against the newest release an option? Since BC3 is opening arguments passed by Git, did you also update or alter Git in any way around the time you updated BC3? You can also use Process Explorer to check the command line used by Git to call Bcomp.exe. It would need to include 2 folders for us to be able to load the locations.

Aaron P Scooter Software

Comment

I do have .gitconfig with 'bc3'. In fact, it works when I use two branches I'm not working with. I'm running on Ubuntu 16.04.
Apparently git version 2.10.0 is not available in the repository using apt-get update, i'll wait a few days and come back to you once I update.

Comment

After those updates, git difftool -d is working again. I've checked the release notes for git and beyond compare and haven't found anything about this issue in any of them, so I'm not sure who fixed it.

Edit: I've run some more tests. Apparently if I do 'git difftool -d' from the root folder, it works, if I'm in a subfolder it doesn't. 'git difftool', on the other hand, works well no matter if i'm in a subfolder or not.

Comment

Thanks for that information. I've set up a similar environment, but I am seeing slightly different behavior. git difftool -d always launches at the top of the repository, even if I execute the command line within a subfolder and only that subfolder contains differences. So, I see a Folder Compare view with only the subfolder (which still needs to be expanded) and the different file within. git difftool -d branchname similarly diffs the entire current branch to named branch. In what location are you browsing on the command line and what is the exact command line you are executing?

Aaron P Scooter Software

Comment

let's say my git repository is at folder 'foo', and there is a subfolder 'foo/mak'
My command is 'git difftool -d'.
If I execute it in 'foo' folder, everything works fine. If I execute it in 'foo/mak' subfolder, my beyond compare launches at the top of the repository, but only the right side shows subfolders with differences that can be expanded. The left side is empty.

Comment

If you run git --version does it report at 2.10.1? The Git website has this version if you build from code, but Ubuntu's apt-get install's latest seems to be 2.7.4. My tests have so far been with 2.7.4; I'm working on making from source, but I'm running into missing dependencies since my VM is mostly a fresh install otherwise.

Comment

I've built from source from git-scm.com. git --version returns
"git version 2.10.0.GIT"

git difftool -d always launches at the top level, even if the command line is in a subfolder/, so I always start at the top and both sides fully populate.

What does your .gitconfig look like? I'd like to verify we have similar setups. If you make any changes to git or the .gitconfig, please reboot to make sure nothing is cached and using old settings or versions. For example, after building, I had to reboot to properly update Git to 2.10.0