commons-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/BCEL-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16960641#comment-16960641
] 

Alex Herbert commented on BCEL-331:
-----------------------------------

The problems of line endings can be solved using [.gitattributes|https://git-scm.com/docs/gitattributes]
with the {{text}} key.

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

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

It identifies the following files for line ending changes:

{noformat}
	modified:   .travis.yml
	modified:   CONTRIBUTING.md
	modified:   NOTICE.txt
	modified:   README.md
	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/DescendingVisitor.java
	modified:   src/main/java/org/apache/bcel/classfile/FieldOrMethod.java
	modified:   src/main/java/org/apache/bcel/generic/INVOKEDYNAMIC.java
	modified:   src/main/java/org/apache/bcel/generic/InstructionHandle.java
	modified:   src/main/java/org/apache/bcel/util/ModularRuntimeImage.java
	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/HandleTestCase.java
	modified:   src/test/java/org/apache/bcel/data/PLSETestClass2.java
	modified:   src/test/java/org/apache/bcel/util/ClassPathTestCase.java
	modified:   src/test/java/org/apache/bcel/util/ModularRuntimeImageTestCase.java
{noformat}

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: https://issues.apache.org/jira/browse/BCEL-331
>             Project: Commons BCEL
>          Issue Type: Bug
>    Affects Versions: 6.4.1
>            Reporter: Michael Ernst
>            Priority: Major
>
> Two of the contribution guidelines at https://github.com/apache/commons-bcel#contributing
are:
> * Respect the code style.
>  * Create minimal diffs - disable on save actions like reformat source code or organize
imports.
> These guidelines are not being respected in the BCEL codebase.
> As an example, conisder this commit:
> https://github.com/apache/commons-bcel/commit/d7292a3d9f2939f785ec74057d255e5df95846bf
> 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
problem.
> 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
happening.
> 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
(v8.3.4#803005)

Mime
View raw message