How to restrict users from committing sources with CRLF or CR.

Hallo!

There is an option in git client (core.autocrlf). According to the option, all the sources should be committed to Git in Linux end-of-line style. According to Stash plugin API, there is not way to check EOL style of the files, as all the committed data is passed line-by-line, already splitted and already without EOL symbols.

How it is suggested to perform this restirction in Stash?

2 answers

1 accepted

0 votes
Accepted answer

Hi Pavel,

If you're happy to build a Stash plugin, you can skip the Stash service layer and use the GitCommandBuilderFactory to grab the raw diff from the underlying repository, as I described in this answer.

Alternatively, you could skip the Stash plugin API altogether install a git crlf hook in your repository on disk. This is a bit less desirable since it'll involve manually installing the hook in each repository you create in Stash.

cheers,

Tim

Thanks a lot. This worked fine for me.

Pavel - what did you end up doing finally?  Is there a plugin that you can share?

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 ...

197 views 3 6
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