Ignore whitespace by default?

In the diff views on the Stash web interface, there is an option to ignore whitespace. This is off by default and has to be switched on every time one visits the web interface.(*)

Is it possible to change the global default setting from off to on in the server's config file or somewhere else?

(*) Feature suggestion: store this in a cookie or the user profile so it persists for every user.

1 answer

1 accepted

2 votes
Accepted answer

There's no setting for changing the default or persisting it longer, unfortunately. The setting is persisted, but only for the life of a browser tab (and any tabs opened from it).

This limited persistence is by design, but I suspect we'll eventually end up extending the persistence to the whole browser indefinitely (as you are not the first to want it). You can track a related issue for side-by-side diff preference here https://jira.atlassian.com/browse/STASH-4693

UPDATE: If you look at that ticket, we've switch to storing this per-browser. So you won't have to update it when returning to Stash Dev in the same browser, but you will have to update it when switching browser

Hi @Adam Ahmed. I saw your last "UPDATE" but it does not seem to persist the "Ignore whitespace by default" option. As soon as I go to a new page and compare a different diff, the option reverts to default and I have to enabled the "ignore" again.

Adam Ahmed Atlassian Team Oct 01, 2018

There could be a few things going on:

1. You've disabled localStorage, so that we can't store the option between page loads.

2. Your localStorage is full. Usually this won't be because of Bitbucket Server, but localStorage space is shared across a whole domain, so any other pages/apps that run on the same domain as Bitbucket Server could be filling it up.

3. It's been long enough since the last time you viewed a PR that we cleaned up the stored option preferences (we do this to conserve space in localStorage). The timeout is 28-56 days (we run every 28 days and remove anything older than 28 days).

4. You're on an old version of Stash.

5. Some other error is occurring in your JS that is stopping us from loading the options.

 

Don't hesitate to open a support case and we can help you debug. It would be useful to see your JS console and whether there are any errors displayed there to see if that is part of the problem.

 

Cheers,

Adam

It is just the Bitbucket cloud server as far as I know.

  1. Nothing abnormal disabled. Adblocker is turned off for testing purposes.
  2. LocalStorage looks normal. Cleared it manually from the Chrome console and tried again without success.
  3. same as above
  4. Bitbucket Server: http://bitbucket.org/companyName
  5. No errors, just warnings

Capture.PNG

Steps:

  1. I cleared my local storage
  2. did a hard refresh on the page.
  3. View a diff of my branch versus another branch.
  4. Set "Ignore whitespace"
  5. Click on branches page
  6. Navigate to the same branch
  7. Compare again this branch to another branch (same as step 3)
  8. "Ignore whitespace" is no longer checked.
Adam Ahmed Atlassian Team Oct 03, 2018

Ah right! This question was originally about Bitbucket Server, which is a different codebase with sometimes different behaviors. Sorry for the confusion there. I think our redesign of these forums made the cloud/server distinction less apparent.

Bitbucket Cloud/bitbucket.org unfortunately hasn't implemented sticky options yet. So what you're seeing is expected.  https://bitbucket.org/site/master/issues/13309/user-setting-to-always-ignore-whitespace looks to be a good issue to track for that. They're putting a lot of effort into improving their PR and diff experience, so I wouldn't be too surprised if they incorporated this if you make your voice heard there.

Cheers!

Adam

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

433 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you