question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Diff should only show changes in renamed file

See original GitHub issue

The diff view shows all lines as new, in case of a renamed file. Only changes between the old and the new files should be shown.

It looks as though this might have been fixed in the past (#495), but I am using v1.0.11 and can reproduce this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
shiftkeycommented, Jan 31, 2018

@vp2177 @j-f1 I’ve got a fix in for the history view in #3892 but detecting renames in the working directory depends on the blobs being staged in the index, and we’ve already found some corner cases about this which are mentioned here.

At this point we’ll display the rename if both files are staged outside Desktop:

If they’re unstaged (or the new file is untracked) our behaviour mirrors Git:

Please open a fresh issue if you have feelings about this experience, so we can track this.

0reactions
shiftkeycommented, Dec 26, 2017

@j-f1 unstaging the whole file is relatively easy. Unstaging a specific hunk or line is where things get really problematic. There might be some part of the Git plumbing that you can do this in, but I’ve not looked for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git diff displaying only changed lines in renamed files
Try this out: git diff --unified -M master feature/x --color-words. It should highlight the words that were changed and not the whole file....
Read more >
git diff issue with renamed file - Google Groups
Without rename, git diff --name-status --cached -- *.{c,h} works as expected: giving list of all the changes. Anything else you want to add:....
Read more >
Understanding renaming/moving files with git - Vjeko.com
Git does not know of a concept of “change”. It only knows of “add” and “delete”. When you change a line of code,...
Read more >
Git - git-diff Documentation - Git SCM
Show only names of changed files. --name-status. Show only names and status of changed files. See the description of the --diff-filter option on ......
Read more >
Renamed large file on pull request does not show diff
If you have a large file in a PR (e.g. with 3000+ lines) and make changes then rename the file, it does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found