Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mdt-papyrus.dev] Git : Formatting and Whitespace

Hi, Benoit,

Indeed, line endings in Papyrus have been a mess for me on Mac (I've raised the issue before).  IIRC, in early days of Eclipse's adoption of git, the core.autocrlf settings that are generally accepted (as you quoted below) were recommended for Eclipse projects by some prominent git-experienced committers.

The problem for a mixed-platform team t is that there really isn't any way for Mac and Linux users to keep whitespace sane when Windows users that they're sharing the code with have autocrlf disabled.  The EMF project went through a painful episode with this same problem a couple of years ago.  I think they ended up having to bulk-update their repo to normalize line endings on LF and mandate the standard autocrlf settings.

We do need to get our repo and developer systems in line with the standard practice.  The procedure for normalizing the line endings in the repo is fairly simple:


These days, the usual practice is to configure line-endings for text files in the .gitattributes file, on a per-repository basis.  It appears that JGit/EGit does not yet support .gitattributes:


cW


On Jul 15, 2014, at 8:03 AM, MAGGI Benoit <Benoit.MAGGI@xxxxxx> wrote:

Hi,
 
Is there an official policy for formatting files in the Papyrus Project ?
 
The official Git documentation promotes a standard configuration:

  Windows :

$ git config --global core.autocrlf true

Linux or Mac :
$ git config --global core.autocrlf input
 
With LF (Not windows CRLF) in the repository
 
 
 
I used this configuration but got many formatting problems
 
I pushed the last set with this configuration :
If you’re a Windows programmer doing a Windows-only project, then you can turn off this functionality, recording the carriage returns in the repository by setting the config value to false:
$ git config --global core.autocrlf false
 
ð  It’s working fine for me but will probably cause problems for mac and linux users
 
Maybe we should initiate a migration from CRLF to LF for the whole git repository ?
Any ideas on how it’s working for other projects ?
 
Regards,
Benoit Maggi
_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev


Back to the top