Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Oct 2005
    Location
    St. Louis, MO, USA, North America, Earth, Sol, Milky Way
    Posts
    7

    Lightbulb Suggestion: GIT branch-to-branch comparison (ala Subversion Profile)

    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.

    * Polytron PVCS, Team Foundations, Subversion, Mercurial, Bazaar, and now Git.
    Last edited by IDisposable; 11-Aug-2016 at 11:35 AM. Reason: Change title

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    Hello,

    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.
    Aaron P Scooter Software

  3. #3
    Join Date
    Oct 2005
    Location
    St. Louis, MO, USA, North America, Earth, Sol, Milky Way
    Posts
    7

    Default

    Yes, I'm hoping for a new Profile type for Git repositories, that would understand (at minimum) at local file reference (to where the .git folder is) or (better) optionally an HTTPS:// protocol https://github.com/GSA/data.gov.git, or (added bonus) optionally an SSH: protocol git@github.com:GSA/data.gov.git

    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...
    Last edited by IDisposable; 11-Aug-2016 at 11:43 AM.

  4. #4
    Join Date
    Oct 2005
    Location
    St. Louis, MO, USA, North America, Earth, Sol, Milky Way
    Posts
    7

    Default

    I never knew about --dir-diff, that's awesome, thanks!

    Any way you can think of to pass the branch names down instead of the directories just being \left and \right

  5. #5
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    I don't believe so. I'm not familiar with a way for Git to pass the branchname as text on the command line:
    https://git-scm.com/docs/git-difftool

    Our command line would accept bcomp.exe "path1" "path2" /vcsleft="branchname1" and /vcsright="branchname2" to override the names presented in the folder paths.
    Aaron P Scooter Software

  6. #6
    Join Date
    May 2015
    Posts
    21

    Default

    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.

    Current git version: 2.9.3
    Current bc version: Version 4.1.8 (build 21575)

  7. #7
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    Hello,

    I tested an older VM with Git 1.8.x and the newest 2.10.0.windows.1, and both function as expected. Is your current .gitconfig using "bc3" as the keyword definition, following our KB article?
    http://www.scootersoftware.com/support.php?zz=kb_vcs

    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

  8. #8
    Join Date
    May 2015
    Posts
    21

    Default

    Hi Aaron,

    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.

  9. #9
    Join Date
    May 2015
    Posts
    21

    Default

    Hello,
    just updated to git 2.10.0 and still same results. git difftool -d does not show any files on the left side.

  10. #10
    Join Date
    May 2015
    Posts
    21

    Default

    Hi,

    my Ubuntu got updated today:
    - beyond compare was updated to 4.1.9
    - git was updated to 2.10.1

    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.
    Last edited by peebles; 06-Oct-2016 at 02:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •