Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2011
    Posts
    1

    Default git difftool load all files into a folder compare view

    Hey,

    I've recently migrated from TortoiseHg/BeyondCompare to GIT/BeyondCompare. When I was comparing commit revisions in Hg, it would load all of the differences into the folder compare view - from there I could double click any file to see its differences.

    I have successfully setup git to use BC3 as both difftool and mergetool. However, when I run 'git difftool' it loads each of the files sequentially as textcompare in bc3 and waits for me to close each file before loading the next one.

    I have found a solution which enables loading of all the files simultaneously, however, they are still loaded as tabbed text compares with no folder compare tree for me to look at. http://blog.codefarm.co.nz/2009/08/g...all-files.html

    Does anyone know how I can load my diffs into a folder view?
    Thanks,
    -- Adam.

  2. #2
    Join Date
    May 2005
    Location
    Germany
    Posts
    43

    Default

    Hi Adam,

    similar to my question from Januar:
    http://www.scootersoftware.com/vbull...ead.php?t=7211

    I have found a solution which enables loading of all the files simultaneously
    Thanks for the hint, it may be usefull for me.
    Stummfilm - ich bin dabei!

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,890

    Default

    I'm not aware of a method for git to compare revisions as Folders. If there are any users who know of a method, please let us know.

    One thing that may be useful is to perform an export of a revision to make a local copy of the repository you want to compare your local files to.
    http://stackoverflow.com/questions/1...ike-svn-export
    Aaron P Scooter Software

  4. #4
    Join Date
    Jul 2017
    Posts
    5

    Default

    Quote Originally Posted by thegoatherder View Post
    Hey,

    I've recently migrated from TortoiseHg/BeyondCompare to GIT/BeyondCompare. When I was comparing commit revisions in Hg, it would load all of the differences into the folder compare view - from there I could double click any file to see its differences.

    I have successfully setup git to use BC3 as both difftool and mergetool. However, when I run 'git difftool' it loads each of the files sequentially as textcompare in bc3 and waits for me to close each file before loading the next one.

    I have found a solution which enables loading of all the files simultaneously, however, they are still loaded as tabbed text compares with no folder compare tree for me to look at. http://blog.codefarm.co.nz/2009/08/g...all-files.html

    Does anyone know how I can load my diffs into a folder view?
    Thanks,
    -- Adam.
    Hello

    I know it's been 6 years since this post, but I really need exactly this and the link is broken. How did you solve this?

    Thanks!

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

    Default

    Hello,

    The key you are looking for is Git's -dir-diff support:
    https://git-scm.com/docs/git-difftool

    Define the difftool as BC, and then add an alias to use --dir-diff --no-symlinks (or just --dir-diff and after launching using the Session Setting: Follow Symbolic Links)
    https://stackoverflow.com/questions/...with-sym-links
    Aaron P Scooter Software

  6. #6
    Join Date
    Jul 2017
    Posts
    5

    Default

    Quote Originally Posted by Aaron View Post
    Hello,
    Define the difftool as BC, and then add an alias to use --dir-diff --no-symlinks (or just --dir-diff and after launching using the Session Setting: Follow Symbolic Links)
    https://stackoverflow.com/questions/...with-sym-links
    Thanks! that helped!

    I just have another question. I noticed that when BC opens, the changes on the working copy are in the "Right" side. Also, the path to the working copy file that appears in the BC "path" field is not the exact path for such file and therefore if I modify something it is not reflected in the actual file.

    Do you know how can I:

    1. Open BC with my working copy file in the "Left" side?
    2. point to the real working copy file path so I'm able to make changes right in BC?


    Thanks!

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

    Default

    BC4's command line expects parameters:
    bcompare.exe "c:\left" "c:\right"

    How have you currently defined your .gitconfig?
    http://www.scootersoftware.com/suppo...vcs#gitwindows

    Git does manage the directories and order automatically, but you could override this by providing more parameter detail.

    As for edits not coming through: if you remove --no-symlinks and instead enable the BC3 option in the Folder Compare's Session menu -> Session Settings -> Handling tab: Follow Symbolic Links, does this show the comparison correctly and allow the editing you need?
    Aaron P Scooter Software

  8. #8
    Join Date
    Jul 2017
    Posts
    5

    Default

    Quote Originally Posted by Aaron View Post
    As for edits not coming through: if you remove --no-symlinks and instead enable the BC3 option in the Folder Compare's Session menu -> Session Settings -> Handling tab: Follow Symbolic Links, does this show the comparison correctly and allow the editing you need?
    Thanks

    The symlinks suggestion worked perfectly. Now if I modify something in BC it gets reflected in the code. So that's solved.

    The thing I haven't been able to figure out is the order. You say that:
    Quote Originally Posted by Aaron View Post
    BC4's command line expects parameters:
    bcompare.exe "c:\left" "c:\right"

    How have you currently defined your .gitconfig?
    http://www.scootersoftware.com/suppo...vcs#gitwindows

    Git does manage the directories and order automatically, but you could override this by providing more parameter detail.
    This is my .gitconfigure contents

    [diff]
    tool = bc3
    [difftool "bc3"]
    trustExitCode = true
    [merge]
    tool = bc3
    [mergetool "bc3"]
    trustExitcode = true
    [alias]
    dif= difftool --dir-diff

    So my question is, what parameters should I specify to override the git directories order and more importantly, how do I specify those parameters?

    Bcause I don't see how I can specify them in the .gitconfig.

    Thanks again! You are being really helpful!

  9. #9
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,890

    Default

    Hello,

    Git has built-in support for using "bc" or "bc3" keywords, which then handles the parameters and everything else automatically. It's the method we recommend using. After load, you can always use the Swap button in the toolbar to flip the view of Left <-> Right

    However, if you further define "cmd" you can pass in the path to the program and parameter list, making a more manual definition of what should be used. GitHub's definition is like this:
    http://www.scootersoftware.com/suppo...#githubwindows

    From Beyond Compare's perspective, our command line is bcompare.exe "left" "right" "base" "merged", so you would need to flip the appropriate variables to fit the view you need. If you are overriding /titles, please be careful to properly match the correct title to the correct variable, or the title might mismatch the data below it.
    Aaron P Scooter Software

  10. #10
    Join Date
    Jul 2017
    Posts
    5

    Default

    Aaron

    Thanks for helping. Finally, I have the results I need!

    For reference and in case somebody else lands in this thread and is looking for this solution, I will add my results here.

    This is for opening BC to compare differences between your working copy and the last commit.

    BC will open the working copy files on the left and the right files will be read only, thus not allowing any changes on the right-side files. Additionally, any changes made in BC editor will be made in the actual working copy files, thus allowing you to "revert" any changes individually by clicking the "Copy to Left" yellow arrow.

    ----------------------------------------------------------------------------------------
    [diff]
    tool = bc3
    [difftool "bc3"]
    cmd = bcompare -rro "$REMOTE" "$LOCAL"
    trustExitCode = true
    [alias]
    dif= difftool --dir-diff
    ----------------------------------------------------------------------------------------

    With that contents in the .gitconfig file, then you just execute

    $ git dif

    And BC will open as described above.
    Last edited by m4l490n; 17-Jul-2017 at 04:04 PM. Reason: Added more information about the solution

Tags for this Thread

Posting Permissions

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