sourcetree, git and line endings on windows (and visual studio)

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Medium
    • 3.4.20
    • Affects Version/s: 1.6.3
    • Component/s: Git
    • Environment:

      version 1.6.4.0 does that too.

    • Severity 2 - Major

      sourcetree modifies line endings in an unwanted way. i noticed this behaviour at least 6 months ago, so it's quite an old bug.

      in the first round i tried to resolve it here:
      https://answers.atlassian.com/questions/5703353/answers/9375631?flashId=362096352

      repro:

      i have a file in stash, that has only one hunk in it. i will attach stashed patch, and few versions of the modified file.

      1) clean repository:
      $ file /d/src/lib/onExit.cpp
      /d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
      2) apply stash:
      $ file /d/src/lib/onExit.cpp
      /d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
      3) select green line
      discard green line by clicking at 'discard lines'
      $ file /d/src/lib/onExit.cpp
      /d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
      4) discard hunk
      $ file /d/src/lib/onExit.cpp
      /d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF, LF line terminators

        1. onExit_discarded_green_line.cpp
          1 kB
        2. onExit_discarded_hunk.cpp
          1 kB
        3. onExit_orig.cpp
          1 kB
        4. onExit_stash_applied.cpp
          1 kB
        5. stash_crlf.patch
          0.6 kB

            Assignee:
            Mukesh Kumar (Inactive)
            Reporter:
            mojmir svoboda
            Votes:
            17 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: