Announcement

Collapse
No announcement yet.

3-Way Merge failing when both created in Git

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 3-Way Merge failing when both created in Git

    Using Git and BC3 Pro.

    When local (left) and remote (right) files are created from a common non existing file, then BC3 Three-Way Merge receives 3 paths: left, middle, right. Them middle file, the common one, doesn't exist.

    The bug is that BC3 doesn't allow to merge when the common file doesn't exist (file not found). The quick fix is to create manually that file which can become pretty tiresome. It's a bug that exists for a long time. Hoping it'll get fixed soon.

    Extra note: My guess is that you BC3 guys don't wish to clearly show to the user when one of the input file is missing. I agree it's a good info and the little (it's little) red cross on BC3 interface is not enough to show that. What you could do it make a nice neat slash bar across the content area of the missing file (see screen mock).

  • #2
    Hello,

    Thanks for the feedback. The bug appears to be Git passing a non-existent file name. If any of the 3 file names present result in an error, we enter the error state and prevent the user from making any edits until the error is resolved. This is designed to help prevent the user from continuing with a merge if they do not notice that the merge is incomplete.

    We can look into making the error state a bit more obvious, but do you have more insight on Git's current behavior? Why would Git pass a file path to a file that does not exist?
    Aaron P Scooter Software

    Comment


    • #3
      First let me state that I didn't contribute to Git's development.

      I agree there is no perfect way. The file didn't exist, which is not the same as a common empty file. The 3 arguments (local, remote, common) must be made available in every case. This means that Git has to put some path in the common (middle), even if it is to a non existing file.

      Changing Git's behavior, would potentially affect tons of existing softwares and in-place batch or such. There might be a way to provide a local customization, but I'm not aware of how to do that this case without directly changing Git's code.
      Last edited by Wernight; 04-Aug-2011, 02:49 AM.

      Comment


      • #4
        Create a little wrapper script that touches each file before passing them to BC. There's a number of Windows touch equivalents listed here.
        ZoŽ P Scooter Software

        Comment


        • #5
          Where didn't you put the wrapper? In which hook?

          Shouldn't BC3 later handle this case differently?

          Comment


          • #6
            Hello,

            The wrapper would be called from git, like a bat file.

            This would then call the touch on each of the parameters passed from git to the bat file (creating each file if it didn't already exist), and then call bcomp.exe as the last step with the parameters. How does this work for you?

            It would be difficult to automatically test for this case. Normally, if you call BC3 with incorrect parameters, we should error and not let you continue, since it is assumed a mistake was made or something unexpected was happening. One workaround could be to add some form of a /git command line argument that, when present, creates files instead of causing an error.
            Aaron P Scooter Software

            Comment


            • #7
              Thanks for the feedback. I hope you'll consider changing the UI to make a missing file more obvious (actually no matter if you allow merging or not with a missing file). In the mean time I'll make a similar script. Git merge.tool --> Batch creating file if missing --> BC3

              Also Git has only the common base missing some times. Left and right are always present as far as I can tell.
              Last edited by Wernight; 05-Aug-2011, 01:39 AM.

              Comment

              Working...
              X