I created a new file based on a existed file in my repository. I committed the file but Stash marked as 'Copied' and not as 'Added'.
Why stash did that?
For Bitbucket Server you can increase a setting causing only very similar files to be recognized as "copied" or "moved".
plugin.bitbucket-git.diff.renames.threshold
There is a similar config for Stash:
plugin.stash-scm-git.diff.renames.threshold
https://confluence.atlassian.com/display/STASH026/Stash+config+properties
Git tracks file content, not files, so in your case Git detected that the new file was very much the same as the original file and recognized it as copied. This should not affect anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any possibility to mark the file as created, to have better diffs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stash probably detected it because it might be using something similar to:
$ git diff -C ...
You'll usually see that you've copied from a similar file if you've modified the file you are "copying" from within the same commit. You can usually still see it as a new file if you run git diff locally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is really frustrating for pull requests. When you're trying to view the new file, BitBucket thinks it's copied from another file just because all of our files start with the same header comment.
Oddly, if I limit the "Show diff of" to the commit where the file was added, it correctly detects it as a new file. But when I view "All changes in this pull request", the error occurs.
Would be nice to have a "mark as new file" or something like that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I agree, this becomes a real problem because the Bitbucket diff for the Copied file only shows the DELTAS from the file it thinks it was copied from, so reviewers only look at those deltas, when they should be reviewing the entire file!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.