-
Bug
-
Resolution: Answered
-
Low
-
None
-
3.6.1
-
None
-
Stash 3.6.1 linux x86_64 on both:
- Fedora 20, git 2.1.0, JDK8
- RHEL6, git 2.2.2, JDK7
If a portion of a file is independently deleted in two branches, then sometimes the diff view is incorrect.
To reproduce, create a new repo in stash, then run the attached shell script (changing the remote URL if needed), and view the diff between master and branch:
Expected results: the diff view shows the first line changed from 'MASTER START' to 'BRANCH START', like 'git diff master branch' shows:
$ git diff master branch
diff --git a/test.txt b/test.txt
index 9199536..91ad9bb 100644
— a/test.txt
+++ b/test.txt
@@ -1,3 +1,3 @@
-MASTER START
+BRANCH START
END
Actual results: the diff view shows the 'MIDDLE' section having been deleted as well as the first line changing
Reversing the source/dest branches (ie http://localhost:7990/stash/projects/TEST/repos/diffbug/compare/diff?targetBranch=refs%2Fheads%2Fbranch) shows the ONLY the middle section changing WITHOUT the first line changing.
This affects both the side-by-side diff and the unified Once a pull request is made, then the diff in the PR is correct.
- relates to
-
BSERV-7375 Stash's branch compare starts at a common ancestor, so the diff shown is misleading
- Not Being Considered
- mentioned in
-
Page Failed to load
[BSERV-7097] Diff is incorrect when source branch modified before destination branch
Workflow | Original: Stash Workflow - Restricted [ 1447181 ] | New: JAC Bug Workflow v3 [ 3135965 ] |
Remote Link | New: This issue links to "Page (Confluence)" [ 405858 ] |
Workflow | Original: Stash Workflow [ 832088 ] | New: Stash Workflow - Restricted [ 1447181 ] |
Link | New: This issue relates to STASH-7375 [ STASH-7375 ] |
Resolution | New: Answered [ 9 ] | |
Status | Original: Needs Triage [ 10030 ] | New: Closed [ 6 ] |
Description |
Original:
If a portion of a file is independently deleted in two branches, then sometimes the diff view is incorrect.
To reproduce, create a new repo in stash, then run the attached shell script (changing the remote URL if needed), and view the diff between master and branch: http://localhost:7990/stash/projects/TEST/repos/diffbug/compare/diff?targetBranch=refs%2Fheads%2Fmaster&sourceBranch=refs%2Fheads%2Fbranch Expected results: the diff view shows the first line changed from 'MASTER START' to 'BRANCH START', like 'git diff master branch' shows: $ git diff master branch diff --git a/test.txt b/test.txt index 9199536..91ad9bb 100644 --- a/test.txt +++ b/test.txt @@ -1,3 +1,3 @@ -MASTER START +BRANCH START END Actual results: the diff view shows the 'MIDDLE' section having been deleted Reversing the source/dest branches (ie http://localhost:7990/stash/projects/TEST/repos/diffbug/compare/diff?targetBranch=refs%2Fheads%2Fbranch) shows the correct result This affects both the side-by-side diff and the unified Once a pull request is made, then the diff in the PR is correct. diff. |
New:
If a portion of a file is independently deleted in two branches, then sometimes the diff view is incorrect.
To reproduce, create a new repo in stash, then run the attached shell script (changing the remote URL if needed), and view the diff between master and branch: http://localhost:7990/stash/projects/TEST/repos/diffbug/compare/diff?targetBranch=refs%2Fheads%2Fmaster&sourceBranch=refs%2Fheads%2Fbranch Expected results: the diff view shows the first line changed from 'MASTER START' to 'BRANCH START', like 'git diff master branch' shows: $ git diff master branch diff --git a/test.txt b/test.txt index 9199536..91ad9bb 100644 --- a/test.txt +++ b/test.txt @@ -1,3 +1,3 @@ -MASTER START +BRANCH START END Actual results: the diff view shows the 'MIDDLE' section having been deleted as well as the first line changing Reversing the source/dest branches (ie http://localhost:7990/stash/projects/TEST/repos/diffbug/compare/diff?targetBranch=refs%2Fheads%2Fbranch) shows the ONLY the middle section changing WITHOUT the first line changing. This affects both the side-by-side diff and the unified Once a pull request is made, then the diff in the PR is correct. |
Attachment | New: stash-diffbug.sh [ 151910 ] |
I know this is closed. But this is extremely confusing for our devs, I would prefer that the diff "preview" was disabled if this is going to stay like this.