Uploaded image for project: 'Sourcetree for Windows'
  1. Sourcetree for Windows
  2. SRCTREEWIN-2294

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • 3.4.20
    • 1.6.3
    • Git
    • 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. stash_crlf.patch
          0.6 kB
        2. onExit_stash_applied.cpp
          1 kB
        3. onExit_orig.cpp
          1 kB
        4. onExit_discarded_hunk.cpp
          1 kB
        5. onExit_discarded_green_line.cpp
          1 kB

              698877135425 Mukesh Kumar
              357fd3a3bf05 mojmir svoboda
              Votes:
              17 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: