• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • None
    • 2.0.5.2
    • General
    • None
    • Severity 2 - Major

      In the newest version 2.0.5.2 of Sourcetree for Mac, the functionality Stage hunk and Stage line generates an error message: apply patch failed.

            [SRCTREE-2942] Stage hunk, Stage line functionality is broken

            Fix is available in version.4.2.7

            Arati Mohanty added a comment - Fix is available in version.4.2.7

            The steps in general are:

            1. begin with multiple hunks containing changes
            2. stage some lines in the top hunk
            3. move to the next hunk, and stage some more lines
            4. repeat with subsequent hunks until the error occurs
            5. if the error does not occur, a different file is needed, containing something unknown that is specific to the bug
              • e.g. different changes, different sizes of hunks, different number of lines staged, etc.

            We don't always see the bug using these steps with every file, but if you do this with enough files, the bug should be easy to reproduce. The workaround I have been using is to open my repository with another git GUI tool and do what I need to do, which always succeeds, therefore I know that the problem is not my operating system, the git binaries, or something else specific to my system.

            If I think of anything else I can share about the issue, I will provide additional comments.

            Matthew Frederes added a comment - The steps in general are: begin with multiple hunks containing changes stage some lines in the top hunk move to the next hunk, and stage some more lines repeat with subsequent hunks until the error occurs if the error does not occur, a different file is needed, containing something unknown that is specific to the bug e.g. different changes, different sizes of hunks, different number of lines staged, etc. We don't always see the bug using these steps with every file, but if you do this with enough files, the bug should be easy to reproduce. The workaround I have been using is to open my repository with another git GUI tool and do what I need to do, which always succeeds, therefore I know that the problem is not my operating system, the git binaries, or something else specific to my system. If I think of anything else I can share about the issue, I will provide additional comments.

            5449055e5c3b We are unable to reproduce the issue in our environment. Could you please share a video in latest version of Sourcetree 4.2.5 with step to reproduce the issue.

            Arati Mohanty added a comment - 5449055e5c3b We are unable to reproduce the issue in our environment. Could you please share a video in latest version of Sourcetree 4.2.5 with step to reproduce the issue.

            All, Thank you for reaching out to us. We will work on this issue and update the status here.

             

            Arati Mohanty added a comment - All, Thank you for reaching out to us. We will work on this issue and update the status here.  

            I see the same error in Sourcetree 4.2.4 (254) very frequently.

            Matthew Frederes added a comment - I see the same error in Sourcetree 4.2.4 (254) very frequently.

            This is still happening with v2.6.1 (125)

            Can stage entire files fine, but not hunks or lines, resulting in error:

            'git apply' failed with code 1:'error: patch failed: js/afterhours.js:1
            error:js/afterhours.js: patch does not apply
            '
            

            leecollings added a comment - This is still happening with v2.6.1 (125) Can stage entire files fine, but not hunks or lines, resulting in error: 'git apply' failed with code 1:'error: patch failed: js/afterhours.js:1 error:js/afterhours.js: patch does not apply '

              2566180e0bc8 Arati Mohanty
              1cafa6e93018 Matt
              Affected customers:
              2 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: