commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Herbert (Jira)" <>
Subject [jira] [Commented] (BCEL-331) Enforce contribution guidelines when committing
Date Sun, 27 Oct 2019 16:46:00 GMT


Alex Herbert commented on BCEL-331:

The problems of line endings can be solved using [.gitattributes|]
with the {{text}} key.

When I run the following on BCEL (these commands are provided on the Git documentation referenced

$ echo "* text=auto" >.gitattributes
$ git add --renormalize .
$ git status        # Show files that will be normalized

It identifies the following files for line ending changes:

	modified:   .travis.yml
	modified:   NOTICE.txt
	modified:   docs/eps/classloader.fig
	modified:   docs/verifier/V_API_SD.eps
	modified:   pom.xml
	modified:   src/changes/changes.xml
	modified:   src/conf/checkstyle.xml
	modified:   src/main/java/org/apache/bcel/classfile/
	modified:   src/main/java/org/apache/bcel/classfile/
	modified:   src/main/java/org/apache/bcel/generic/
	modified:   src/main/java/org/apache/bcel/generic/
	modified:   src/main/java/org/apache/bcel/util/
	modified:   src/site/xdoc/download_bcel.xml
	modified:   src/site/xdoc/index.xml
	modified:   src/site/xdoc/issue-tracking.xml
	modified:   src/site/xdoc/mail-lists.xml
	modified:   src/test/java/org/apache/bcel/
	modified:   src/test/java/org/apache/bcel/data/
	modified:   src/test/java/org/apache/bcel/util/
	modified:   src/test/java/org/apache/bcel/util/

So there are a few offending java source files and a few other in there too. I do not think
that any files identified are not text files. The EPS files are human readable and editable.

> Enforce contribution guidelines when committing
> -----------------------------------------------
>                 Key: BCEL-331
>                 URL:
>             Project: Commons BCEL
>          Issue Type: Bug
>    Affects Versions: 6.4.1
>            Reporter: Michael Ernst
>            Priority: Major
> Two of the contribution guidelines at
> * Respect the code style.
>  * Create minimal diffs - disable on save actions like reformat source code or organize
> These guidelines are not being respected in the BCEL codebase.
> As an example, conisder this commit:
> The commit ought to be just a few lines long, but instead it changed every line in two
files by changing the line endings from Unix style to DOS style.
> This makes the commit history not helpful for understanding the changes, and it is extremely
disruptive for people who are maintaining forks.
> This is not an isolated incident -- there have been many other commits with the same
> Could you please put a mechanism in place to encourage developers to follow the guidelines?
Developers should set up their editor to maintain line endings, but that is not currently
> Here are some suggestions:
>  * add a pre-commit hook that prevents commits that change line endings
>  * add a pre-commit hook that enforces a uniform line ending style (I don't care whether
it is Unix or DOS, so long as no future commits change it).
>  * lock the master branch and require code reviews, to catch problems when a developer
carelessly changes line endings
> Maybe you have other ideas for enforcing the guidelines; anything that prevents these
disruptive commits from polluting the history would be fine with me.
> Thanks!

This message was sent by Atlassian Jira

View raw message