Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Pavel Baranchikov November 14, 2014

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
Answer accepted
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2014

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

0 votes
Pavel Baranchikov November 19, 2014

Thanks a lot. This worked fine for me.

EricB December 22, 2016

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
TAGS
AUG Leaders

Atlassian Community Events