Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext workflow and GIT
Xtext workflow and GIT [message #648392] Wed, 12 January 2011 16:58 Go to next message
Mark Christiaens is currently offline Mark ChristiaensFriend
Messages: 63
Registered: October 2010
Member
This is just a minor peeve but Xtext (2.0 M4) does a few things that annoy Git:

  • The workflow (Generate*.mwe) replaces the MANIFEST.MFs each time with versions with Windows line ending (on my Linux box). Git then complains. Maybe it could be changed to generate files that respect the platform's line endings?
  • I've told Git to ignore the content of the generated src-gen directories. However, it seems that I do need to have src-gen directories in place. So I've put a .gitignore in the src-gen (else Git is not happy with an empty dir in its repo) and checked the (for the rest empty) src-gen directories in. However, that .gitignore is removed at each run of the workflow. Is there a better way?

---
Mark Christiaens
Discover the Future of VHDL Design
Go to www.sigasi.com
Re: Xtext workflow and GIT [message #648395 is a reply to message #648392] Wed, 12 January 2011 17:21 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Mark,

the directory cleaner allows to define an exclude filter. Ignoring
..gitignore should help.
Please file a ticket for the first issue. It is caused by
buffer.append("\r\n"); in MergableManifest#write(OutputStream).

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 12.01.11 17:58, schrieb Mark Christiaens:
> This is just a minor peeve but Xtext (2.0 M4) does a few things that
> annoy Git:
>
> The workflow (Generate*.mwe) replaces the MANIFEST.MFs each time with
> versions with Windows line ending (on my Linux box). Git then complains.
> Maybe it could be changed to generate files that respect the platform's
> line endings?
> I've told Git to ignore the content of the generated src-gen
> directories. However, it seems that I do need to have src-gen
> directories in place. So I've put a .gitignore in the src-gen (else Git
> is not happy with an empty dir in its repo) and checked the (for the
> rest empty) src-gen directories in. However, that .gitignore is removed
> at each run of the workflow. Is there a better way?
>
> ---
> Mark Christiaens
> Discover the Future of VHDL Design
> Go to http://www.sigasi.com
Re: Xtext workflow and GIT [message #648396 is a reply to message #648395] Wed, 12 January 2011 17:23 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Interestingly, java.util.Manifest uses \r\n, too. We should investigate
why they do this before changing the behavior of MergableManifest.


Am 12.01.11 18:21, schrieb Sebastian Zarnekow:
> Hi Mark,
>
> the directory cleaner allows to define an exclude filter. Ignoring
> .gitignore should help.
> Please file a ticket for the first issue. It is caused by
> buffer.append("\r\n"); in MergableManifest#write(OutputStream).
>
> Regards,
> Sebastian
Re: Xtext workflow and GIT [message #648497 is a reply to message #648392] Thu, 13 January 2011 08:52 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I was about to write a similar post too, since I'm experiencing this
problem too...

probably one could tell git to ignore eol?

cheers
Lorenzo

On 01/12/2011 05:58 PM, Mark Christiaens wrote:
> This is just a minor peeve but Xtext (2.0 M4) does a few things that
> annoy Git:
>
> The workflow (Generate*.mwe) replaces the MANIFEST.MFs each time with
> versions with Windows line ending (on my Linux box). Git then complains.
> Maybe it could be changed to generate files that respect the platform's
> line endings?
> I've told Git to ignore the content of the generated src-gen
> directories. However, it seems that I do need to have src-gen
> directories in place. So I've put a .gitignore in the src-gen (else Git
> is not happy with an empty dir in its repo) and checked the (for the
> rest empty) src-gen directories in. However, that .gitignore is removed
> at each run of the workflow. Is there a better way?
>
> ---
> Mark Christiaens
> Discover the Future of VHDL Design
> Go to http://www.sigasi.com


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Xtext workflow and GIT [message #648506 is a reply to message #648497] Thu, 13 January 2011 10:00 Go to previous messageGo to next message
Mark Christiaens is currently offline Mark ChristiaensFriend
Messages: 63
Registered: October 2010
Member
I've tried to tell Git to require CRLF line endings for MANIFEST.MF files by putting
*.vcproj        eol=crlf

in .gitattributes in the root of my project. Seems to work so far.

---
Mark Christiaens
Discover the Future of VHDL Design
Go to www.sigasi.com
Re: Xtext workflow and GIT [message #648521 is a reply to message #648506] Thu, 13 January 2011 10:55 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 01/13/2011 11:00 AM, Mark Christiaens wrote:
> I've tried to tell Git to require CRLF line endings for MANIFEST.MF
> files by putting
> *.vcproj eol=crlf
>
> in .gitattributes in the root of my project. Seems to work so far.

shouldn't it be?

*.MF eol=crlf

what does that line do?
If the difference is only the line ending it does not consider that line
as changed?

thanks
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Xtext workflow and GIT [message #648529 is a reply to message #648521] Thu, 13 January 2011 12:09 Go to previous messageGo to next message
Mark Christiaens is currently offline Mark ChristiaensFriend
Messages: 63
Registered: October 2010
Member
Yes of course. I cut-and-pasted the wrong line. Rolling Eyes

The line tells Git that if any subdirectory contains a file with .MF extension then it's supposed to use the Windows convention for line endings. See the attributes manual page of Git.
Re: Xtext workflow and GIT [message #648591 is a reply to message #648529] Thu, 13 January 2011 15:35 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 01/13/2011 01:09 PM, Mark Christiaens wrote:
> Yes of course. I cut-and-pasted the wrong line. :roll:

no problem ;)

> The line tells Git that if any subdirectory contains a file with .MF
> extension then it's supposed to use the Windows convention for line
> endings. See the
> http://www.kernel.org/pub/software/scm/git/docs/gitattribute s.html of Git.

mh... I read the original post better, and actually I have a different
problem:

I usually develop on Linux, but sometimes I use also Windows.

If I change the .xtext file grammar, and regenerate the language
artifacts under windows, then, even a few things have changed, both
..ecore, .genmodel, and EMF classes are seen by git as completely new due
to line endings...

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Xtext workflow and GIT [message #648599 is a reply to message #648591] Thu, 13 January 2011 16:02 Go to previous messageGo to next message
Mark Christiaens is currently offline Mark ChristiaensFriend
Messages: 63
Registered: October 2010
Member
Are you using core.autocrlf=input (see git config). If not, it's probably something like that what you need. It converts the line endings (at checkout) to the platform's standard.

---
Mark Christiaens
Discover the Future of VHDL Design
Go to www.sigasi.com
Re: Xtext workflow and GIT [message #648608 is a reply to message #648599] Thu, 13 January 2011 16:08 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 01/13/2011 05:02 PM, Mark Christiaens wrote:
> Are you using core.autocrlf=input (see git config). If not, it's
> probably something like that what you need. It converts the line endings
> (at checkout) to the platform's standard.

I guess that's what I was looking for! :)

I'll try that!

thanks
Lore

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Previous Topic:Help with Scoping Implementation
Next Topic:Issue with white space, optional rules, and serialization
Goto Forum:
  


Current Time: Sat Apr 27 02:17:39 GMT 2024

Powered by FUDForum. Page generated in 0.04039 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top