It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why does one file in my project think its completely being changed?

So I'm using source tree and I'm working on a website, however 1 of my JS files ALWAYS treats the whole file as a single hunk. Hunk 1: Lines 0-0 It shows the first line as removed, then the whole file in white then the first line in green and the whole file in white. So its impossible to review what changes I made, discard or change individual hunks/lines. No other file is doing this and its only this file. It also appears this way in bitbucket so without doing a side-by-side diff I can't see what changes were done. Why is this happening? What steps should I take to resolve this?

2 answers

I would suspect white-space changes, possibly line-endings. Is SourceTree configured to show whitespace changes in the diff panel?

Yes, if I add a few empty lines to a normal files it'll show as new empty lines in source tree.

By "line-endings", I don't mean extra newlines, I mean the different byte sequences that can be used to signify a new line based on the source OS.

If you switch sourcetree to ignore whitespace, you should be able to get a useable diff.

So I actually checked the settings and it's already set to ignore white space, I was testing with new lines.

FYI SourceTree's diff panel doesn't seem to have a clue about displaying files that use Classic Mac line endings.

FYI if you set a file to be executable it will show as changed but without showing any lines have actually changed.

If its the line endings why is only one file effected? How do I change this file to a crlf endings? If its executable how to a revert that?

I had the same problem, Hunk 1: lines 0-0 and it would not show updates in the file.  I was able to solve the problem by copying the code, deleting the (php) file in question, creating it again fresh, and pasting the code back in. YMMV.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,917 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you