Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Project decoration question
Project decoration question [message #731425] Fri, 30 September 2011 23:17 Go to next message
Brian Payton is currently offline Brian PaytonFriend
Messages: 154
Registered: July 2009
Senior Member
I have the text decoration preference for the Git projects in my
workspace set like this:

{dirty:>} {name} [{repository} {branch}]

And let's say I have a project "foo_project" which is stored in the
"bar_repo" Git repository. So the project in my workspace looks like this:

foo_project [bar_repo master]

Now I right-click on my project and do the action "Replace With ->
Branch, Tag, or Reference..."

In the Replace dialog I expand the Remote Tracking node and select the
origin/Foo_1_1_Branch branch.

Shouldn't the project text decoration change to this?

foo_project [bar_repo Foo_1_1_Branch]

But it doesn't. It's just the same as it was before, namely

foo_project [bar_repo master]

That makes it hard to tell which projects belong to which branches.

Should it show the branch I selected? Or am I (as usual) just not yet
understanding eGit correctly?
Re: Project decoration question [message #731485 is a reply to message #731425] Sat, 01 October 2011 10:01 Go to previous messageGo to next message
Dariusz Luksza is currently offline Dariusz LukszaFriend
Messages: 40
Registered: July 2010
Member

'Replace With' means 'overwrite all files in current branch with those from given branch/version' it doesn't change branch. For switching branch use 'Switch to' menu option.
Re: Project decoration question [message #732120 is a reply to message #731485] Mon, 03 October 2011 23:28 Go to previous messageGo to next message
Brian Payton is currently offline Brian PaytonFriend
Messages: 154
Registered: July 2009
Senior Member
OK, thanks. However, "Switch to" appears to work at the repository
level. I can switch to a different branch, and then ALL the projects
imported from that repository get switched to that branch.

Is there a way to have a mix of projects from different branches in the
same Eclipse workspace? I might want to see if plugin foo_project from
the master branch compiles OK with other plugins from branch
Foo_1_1_Branch, for example. (Where foo_project and the other plugins
are in the same Git repository.)

Also, is there a way to have one Eclipse workspace with all the plugins
imported from the master branch, and another one with all the plugins
imported from branch Foo_1_1_Branch? (With both Eclipse workspace
instances using the same Git repository.)

On 10/1/2011 3:01 AM, Dariusz Luksza wrote:
> 'Replace With' means 'overwrite all files in current branch with those
> from given branch/version' it doesn't change branch. For switching
> branch use 'Switch to' menu option.
Re: Project decoration question [message #732215 is a reply to message #732120] Tue, 04 October 2011 09:16 Go to previous message
Dariusz Luksza is currently offline Dariusz LukszaFriend
Messages: 40
Registered: July 2010
Member

Information about currently used branch isn't stored in EGit it is keep in yours git repository. This is how git works, therefore if you have same local repository imported in many eclipse workspaces switching branch in one of them will cause same action in rest. A solution for this is to have separate git repositories for each workspace.

Also you cannot checkout two branches at a time. Branches works on repository level (as you write) and cannot be reduced to particular resource scope ... but you can reset particular folder. This currently isn't supported by EGit but it is possible to do from command line eg:

git reset v1.0.0.201106071701-r org.eclipse.egit.mylyn-feature/

will reset all file in org.eclipse.egit.mylyn-feature/ to state from version v1.0.0.201106071701-r (of course you can also pass branch name or SHA-1 instead of tag).
Previous Topic:Some general status questions
Next Topic:HTTPProxy failure using ssh protocol?
Goto Forum:
  


Current Time: Sat Sep 21 01:31:06 GMT 2019

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

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

Back to the top