Diff should only show changes in renamed file
See original GitHub issueThe 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:
- Created 6 years ago
- Comments:8 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@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.