[cryptography] openssl on git

Jeffrey Altman jaltman at secure-endpoints.com
Tue Jan 8 13:42:10 EST 2013

On 1/8/2013 1:21 PM, Ben Laurie wrote:
> On 8 January 2013 18:06, Jeffrey Walton <noloader at gmail.com> wrote:
>> Would you consider adding a hook to git (assuming it include the ability).
>> Have the hook replace tabs with white space. This is necessary because
>> different editors render tabs in different widths. So white space
>> makes thing consistent for everyone.
>> Then have the hook format the source code against some standard. I
>> don't care which, as long as its consistent.

Git does support hooks but any hook that modifies the patchset must be
executed on the system that performs the commit to the local repository.
Otherwise the sha1 of the patch in the local repository does not match
the commit in the remote repository.

What you can do is apply a hook in the upstream repository that rejects
patches that fail various tests.

OpenAFS uses Gerrit as a patch review system.  One of the benefits of
Gerrit is that it highlights whitespace errors.  Our policy is that
patches submitted to Gerrit will fail review if the formatting is
incorrect.  We block patchsets ending up in the repository via that manner.

> Funnily enough we've been discussing this.
> The problem is that the vast majority of the code is formatted to look
> OK with pure tab indentation. Which means that with tabs set to a
> standard 8 columns it sucks (though that does appear to be what was
> used in the original code base).
> People are reluctant to change _all_ the code for the sake of
> indentation and so the current favourite option is to adopt a code
> style that works with different tab widths (specifically 4 and 8
> column) and use no spaces. I realise that almost no-one works this
> way, but it does seem like a sensible option in this case.
> I would certainly like to have an agreed style that is consistent.

OpenAFS has performed various code formatting cleanups over the years
across the entire code base.  The major downside of such efforts is that
"git pickaxe" or "git blame" should less meaningful output because the
entire tree has been altered.   However, openssl is in the process of
converting the repository from cvs to git.  One of the things that could
be done in the process is to reformat each patchset from cvs before
committing it to git.  This would ensure the history is maintained while
also ensuring format consistency across the tree.

Jeffrey Altman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: OpenPGP digital signature
URL: <http://lists.randombit.net/pipermail/cryptography/attachments/20130108/aff6418d/attachment.asc>

More information about the cryptography mailing list