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

Exclude files from Bitbucket's new pull request experience Edited

tk Atlassian Team Jan 29, 2019

Hello community!

I'm excited to share that we've released a new feature called Excluded files. You can now exclude files in large diffs on pull requests for which you are the admin, so the review process is easier for everyone involved.

To enable the new feature, go to the repository containing the pull request and click Settings > Excluded files in the Pull Requests section. Learn more.

Please note that for now, the Excluded files filter is only available in the new pull request experience.

Happy coding!

Tom

Bitbucket Developer

3 comments

Super excited about the "Excluded files" feature - it's VERY needed as all our diffs are difficult to manage with package-lock.json changes.

HOWEVER, I cannot seem to get it to work. I have tried turning on "New pull request experience" but it has NO EFFECT on our PR's. I'm not sure why... is there an initialization time of some sort? I've tried turning it off and on, creating PR's after turning it on, to no avail. Can someone help?

Tyler Tadej Atlassian Team Feb 21, 2019

As @Alastair Wilkes mentioned in your other post - this might be caused by toggling the feature for a team account versus a personal account. The "New pull request experience" feature can only be activated on a personal account level.

For others that have run into the same issue, please see this post: https://community.atlassian.com/t5/Bitbucket-questions/quot-New-pull-request-experience-quot-has-no-effect/qaq-p/1014162#M38857

Thank you Tyler. Yep, that was the problem. I also had to clear cookies for BitBucket.org in order to see the new experience.

It's completely pointless to still generate HTML for excluded files. I am trying to utilize Exclude Files to slim down a pull request that fails to load due to having 5000+ files. But because 99% of the files are in an excluded directory, *AND* those files still generate HTML which requires massive load time, the PR still won't load!

You should not generate UI or data for excluded files. Excluded files should not require processing of any kind. Why is the server/client code still having to process excluded files? How am I supposed to exclude our third party libraries directory so that it doesn't cause PRs to fail to load due to number of files?!

tk Atlassian Team Tuesday

Hi Robert,

I apologize that I wasn't notified of your message sooner.

Due to technical constraints, we filter out excluded files after the diff is calculated. In the future we plan to filter files before the diff is calculated but it will require changes and upgrades to underlying core components. The feature can still reduce the page to a reasonable size for all but the most massive PRs.

On the PR page you will see a placeholder card for each excluded file, which would result in a large page load if you have 5000+ files in a PR. Are you referring to these placeholder cards when you say the PR is "generat[ing] HTML for excluded files"? You shouldn't be seeing diffs for those excluded files unless you click the link in the placeholder card.

This information surely comes too late to help you with your large PR but I wanted to explain the reasoning.

Regards,

Tom

Yes, I'm referring to the placeholder cards. I do not see diffs, so in that respect the feature is "working as intended", but my feedback is really to say that the feature, as designed, is not good enough for my specific use case.

tk Atlassian Team Wednesday

I would like to hear more about your specific use case.

Do you (and/or your team) intend to actually review this PR with 5000+ files? You want to approve the changes to files that aren't in the excluded directory?

Or are you using PRs as a way to merge a batch of changes but you aren't actually reviewing the diff?

If I work on a feature where I modify our normal code, and add a new third party library in to support implementing this feature, there is now essentially two categories of changes: Changes to our own code, and addition of code that we do not own, maintain, or care to look at.

For changes to our own code, we do want to code review those changes. When we add a third party library, that's not our code, but still required to implement the feature. So we don't want to review that third party library code, but it is required to be in version control so it is available.

To keep feature development atomic, we merge everything in together. So really we use exclusions as a mechanism to ignore changes in our "Third Party" directory so that we're only code reviewing the changes to stuff we care about. Just because something is in version control doesn't mean I want to diff it.

The way I would do this on the command line is:

$ git diff origin/master -- :^ThirdParty

This means exclude any and all changes under the "ThirdParty" directory when I do my diff. Effectively, this is how I want exclusions to function in pull requests too. The PR should really just be our visual diff tool on the web. The part you are functionally missing here is the ability to provide a pathspec (the part after the `--`).

Like tk likes this

Hello,
File excluding feature is awesome and we love it.
But, can I set global exclude settings for all repositories, which will merge with current repository settings while opening PR ? or internal settings may override global settings.
like *.Designer.cs or *.min.js files.

if no, are you planning to make it?

@tk Hello, do you have any information about my question?

tk Atlassian Team Tuesday

Hi Luka,

I apologize that I wasn't notified of your message sooner.

Bitbucket does not currently support Excluded files settings for more than one repository at a time. One reason we chose to use a text field for the Excluded files setting is so that it's easy to copy/paste from one repository to another.

We may consider a setting that applies to several repositories in the future but we have no definite plans.

I hope that helps.

Tom

Hello,
Thank you for reply.
I hope you will add this in global settings.

Comment

Log in or Sign up to comment
Community showcase
Published in Bitbucket

Atlassian supported Jenkins integration for Bitbucket Server

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...

505 views 0 10
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