Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-4147

SourceTree hangs when launching external diff (FileMerge)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • None
    • 2.3.1
    • None
    • None
    • Mac OS 10.11.6 (El Capitan)

    • Severity 2 - Major

      When doing an external diff with FileMerge (may happen with other apps as well), SourceTree will hang if FileMerge isn't already running. This is 100% reproducible:

      1. In Preferences, select FileMerge as the visual diff tool.
      2. Make sure FileMerge is not already running.
      3. Do an external diff, which will launch FileMerge.

      Result: SourceTree will hang (beachball) until you quit FileMerge – closing the file window will not suffice.

      Expected result: SourceTree should continue to respond and operate independently of FileMerge.

      Workaround: In Xcode, launch FileMerge manually (Xcode->Open Developer Tool->FileMerge) before doing an external diff. If it's already running, the hang won't occur.

      Suspected cause: SourceTree launches the external diff application synchronously and must therefore wait until it exits. It should be launched asynchronously.

            [SRCTREE-4147] SourceTree hangs when launching external diff (FileMerge)

            Issue fixed in 4.2.5. Kindly upgrade the Sourcetree Version and verify.

            Arati Mohanty added a comment - Issue fixed in 4.2.5. Kindly upgrade the Sourcetree Version and verify.

            SourceTree needs to know when you are done with "merging". When you start an external process, the only information that you as parent process are guaranteed to receive is the information that your child process has just died, as well as its exit code. Thus SourceTree waits until the process has died, knowing for sure that you are done merging when this happens, and to prevent any data race conditions, it blocks until this has happened.

            How else would you like SourceTree to work?

            Unblock when you close the FileMerge window? SourceTree won't be informed when you close that window. Monitoring windows of another process is not easily possible (SourceTree would have to register as an Accessibility Helper process, requiring the user to authenticate SourceTree for this task and then using the Accessibility API it would be possible to retrieve a list of Windows from another process, albeit still very complex).

            Monitoring the merged file for changes? Just because you hit CMD-S and FileMerge and save the current merge output doesn't mean you are done merging, as you can still make changes and hit CMD-S again. SourcTree cannot continue until it knows for sure that you are done and monitoring the file for changes simply won't tell it whether you are done or not.

            See also SRCTREE-2674.

            Markus Hanauska added a comment - SourceTree needs to know when you are done with "merging". When you start an external process, the only information that you as parent process are guaranteed to receive is the information that your child process has just died, as well as its exit code. Thus SourceTree waits until the process has died, knowing for sure that you are done merging when this happens, and to prevent any data race conditions, it blocks until this has happened. How else would you like SourceTree to work? Unblock when you close the FileMerge window? SourceTree won't be informed when you close that window. Monitoring windows of another process is not easily possible (SourceTree would have to register as an Accessibility Helper process, requiring the user to authenticate SourceTree for this task and then using the Accessibility API it would be possible to retrieve a list of Windows from another process, albeit still very complex). Monitoring the merged file for changes? Just because you hit CMD-S and FileMerge and save the current merge output doesn't mean you are done merging, as you can still make changes and hit CMD-S again. SourcTree cannot continue until it knows for sure that you are done and monitoring the file for changes simply won't tell it whether you are done or not. See also SRCTREE-2674 .

            David Gish added a comment - - edited

            This issue was referred to in SRCTREE-2068 (a hang with a different taxonomy), but not described correctly. Independently reported as SRCTREE-4146; recommend merging SRCTREE-4146 and SRCTREE-4147.

            David Gish added a comment - - edited This issue was referred to in SRCTREE-2068 (a hang with a different taxonomy), but not described correctly. Independently reported as SRCTREE-4146 ; recommend merging SRCTREE-4146 and SRCTREE-4147 .

              Unassigned Unassigned
              1ba5058dc088 David Gish
              Affected customers:
              1 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: