Controlling eGit's treatment of symbolic links
Asked Answered
G

2

7

I am setting up a project that will be shared among several programmers at my organization. We are using git--to which I am a newcomer. The project directory includes symbolic links to documentation directories that should not be under version control. I want to maintain the symlinks under version control as symlinks, rather than having them dereferenced and all of the content of the symlinked directory placed under version control.

I find that the git command line tool behave the way I want: git add -A. However if I try to use the Eclipse version of git, eGit, to add all the currently unversioned files, using Team->Track on the project context menu, eGit wants to add every file in the symlinked directories. Is there a way to tell eGit that, no, these are really symlinks, and should not be dereferenced?

Gliwice answered 22/7, 2010 at 14:47 Comment(4)
Not an answer to your question, but if you're new to git, I highly recommend reading this: progit.org/book I've tried a few DVCS, and fumbled around with just making commits with git, but once I made it to/through chapter 3 I've felt like I could really be fairly powerful. You should read it (and anyone on your team who hasn't!)Rowden
My two cents: I just recently had a look at EGit, and speaking as someone who knows git pretty well, I'd say you're kind of shooting yourself in the foot by using it. Plenty of commonly used git features aren't implemented yet, most notably merge (except fast-forward). You have to use git pull from outside eclipse. Yeah, you can still use EGit for some things, but why use an awkward plugin that forces you to go through lots of right-click menus, when you could just use git/msysgit? There's always git-gui and gitk, if you insist on a GUI - and they're cleaner than EGit's interface.Parliament
@Jefromi: I am beginning to reach the same conclusion.Gliwice
@Jefromi: There are a couple of great Mylyn-integration features that would be a wonderful to have. These are what drew me towards trying EGit in the first place. However, currently I'm still using the commandline and gitk for most of my work.Insipience
I
4

Our problem was discussed in this: Eclipse Community Forums Thread

It looks like currently the Linux native lstat support is not too easy to make portable. The Least Common Denominator paradigm that they have for programming Eclipse in Java make it harder to do Linux or Mac native stuff. (read: *cough* Windows doesn't support symlinks *cough*).

The good news is:

It seems possible, but they'd need to code it in a way that complies to their 'Write Once Test Everywhere' programming standards. I feel that it's important to have some native stat and lstat support on Linux when using EGit because of this problem, as well as Eclipse bug #346079.

Simply having EGit installed causes slowdowns & IDE freezes when doing a Git Refresh :-(

The bad news is:

These two bugs are stopping me from using EGit for the majority of my git commands. The user experience makes EGit unusable for me. It would be really nice to be able to use EGit within Eclipse so that Mylyn User Stories & Tasks could be tied to feature branches automatically. It would also be great to have the automatic commit message template features. This would make putting the current task & status in the commit message a breeze.

This is bugging me almost enough that I'm ready to see if it's possible to make some scripts to query Eclipse / Mylyn for the current commit message template output, and do the git commit from the commandline using this. I'm not sure how automatic per-user-story feature branch creation would work though.

Until these problems get fixed, I'm sure a lot of EGit users will not be happy :-(

Insipience answered 23/9, 2011 at 2:12 Comment(3)
Windows does support symlinks though. MklinkNeumann
Yes, it's true that newer versions of Windows do (Win Server 2008, Vista, Win7 and onward). It's probably possible that the eclipse folks could use this functionality, but I'm unsure about how backwards-compatible they want to be with older versions of Windows.Insipience
The other problem was that Java didn't support symlinks before 1.7Ahoufe
S
4

We suffered from this problem cluttering up the commit screen no end, and occasionally causing someone to forget to include a file they had created.

The solution we came up with was to manually edit the .gitignore files to include the paths where the linked files would appear when the symlinks were dereferenced:

/ProjectHomeFolder/.gitignore

Since we were working in the Play Framework we also edited the following ignores: /ProjectHomeFolder/conf/.gitignore
/ProjectHomeFolder/public/.gitignore

We simply added /ModuleName for each of the modules that were symlinked and now egit ignores them properly, for completeness here is the full contents of my root .gitignore file, that sits in the root directory of the project:

/.project
/.classpath
/.gitignore
/eclipse
/tmp
/crud
/.git
/.settings
/modules
/conf
/betterlogs-1.0
/chronostamp-0.1
/logisimayml-1.5
/betterlogs-1.0
/sass-1.1
/deadbolt-1.4.2
/jquery-1.0
/log4play-0.5
/messages-1.1.1
/navigation-0.1
/jqueryui-1.0
/scaffold-0.1
/table-1.2
/tabularasa-0.2

Shastashastra answered 19/10, 2011 at 10:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.