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


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

This widget could not be displayed.

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.



This widget could not be displayed.

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 Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,310 views 8 11
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