Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329061 - Committing non workspace changes
Summary: Committing non workspace changes
Status: CLOSED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.10.0   Edit
Hardware: PC Windows 7
: P3 enhancement with 4 votes (vote)
Target Milestone: 1.0.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 12:28 EDT by Jens Baumgart CLA
Modified: 2012-02-21 10:53 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Baumgart CLA 2010-10-29 12:28:03 EDT
The current EGit commit dialog can only commit changes in a Git repository if the changed files are inside the workspace.
There are at least two scenarios where changes outside the workspace occur:

(1) Delete a shared project in Eclipse (including contents). Afterwards you are not able to commit the changes.

(2) The Git repository root folder contains a number of shared projects. In this case the files located directly below the repository root folder are outside the Eclipse workspace.

Example: EGit Git repository


d020964@WDFD00217740A /c/git/egit (master)
$ ls -a -l
total 41
.
..
.eclipse_iplog
.git
.gitattributes
EGIT_INSTALL
LICENSE
README
SUBMITTING_PATCHES
org.eclipse.egit
org.eclipse.egit-feature
org.eclipse.egit-updatesite
org.eclipse.egit.core
org.eclipse.egit.core.test
org.eclipse.egit.doc
org.eclipse.egit.source-feature
org.eclipse.egit.ui
org.eclipse.egit.ui.test
pom.xml
tools

If you e.g. change LICENCE you are not able to commit this change with EGit afterwards.
As a workaround you can create a general project "EGit" with location /c/git/egit. But in this case
you have to deal with nested projects. I tried this and got some issues:

1. The folders of the nested projects are shown in the General project. Folders which are derived in the nested projects are NOT derived in the top level project and get decorated. A lot of decoration overhead occurs because decoratinng the project resource is already very expensive (decorator goes through the complete project tree).
 
2. Nesting causes the problem that 2 Eclipse resources exist for the same repository file.

Summarized I think working with a nested project is no good solution.

To avoid using nested projects and to solve the issue in (1) we could enhance EGit in a way that it can deal with changes outside the workspace. The following would be required to achieve this:

PROPOSALS
=========

1. Extend the commit dialog to show / commit ALL changes in the Git repository.

2. Introduce the relevant Git actions (add, rm, ...) in the Git Repositories View in the working directory tree.
This would allow to perform Git operations on files which are not in the workspace.

Comments?
Comment 1 Gunnar Wagenknecht CLA 2010-10-29 16:08:12 EDT
(In reply to comment #0)
> PROPOSALS
> =========
> 
> 1. Extend the commit dialog to show / commit ALL changes in the Git repository.
> 
> 2. Introduce the relevant Git actions (add, rm, ...) in the Git Repositories
> View in the working directory tree.
> This would allow to perform Git operations on files which are not in the
> workspace.

+1

I remember myself looking for (2) some time ago. It just makes sense to perform some (most?) repo operations from the repositories view. I even wonder if there are operations that don't make sense for single projects but in the repositories view?
Comment 2 Matthias Sohn CLA 2010-11-05 09:40:26 EDT
+1 for both proposals
Comment 3 Michael CLA 2011-04-13 08:53:58 EDT
Can I point out that as it stands EGit simply has nothing analogous to performing "git status" on the command line which takes a repository wide view (regardless of what is in Eclipse Projects) and is of course fundamental to working with git.

I also like the idea of adding something to do this to Repository View.
Comment 4 Matthias Sohn CLA 2011-04-19 07:30:41 EDT
(In reply to comment #3)
> Can I point out that as it stands EGit simply has nothing analogous to
> performing "git status" on the command line which takes a repository wide view
> (regardless of what is in Eclipse Projects) and is of course fundamental to
> working with git.

Then you maybe want to review http://egit.eclipse.org/r/#change,3106
Though this still doesn't support non-workspace resources but I asked Bernard
if he could add this.
Comment 5 Jens Baumgart CLA 2011-05-11 15:40:12 EDT
http://egit.eclipse.org/r/#change,3369 implements committing non workspace changes.
Comment 6 Doug Schaefer CLA 2012-02-21 10:22:43 EST
Wondering why this is still New. It seems like this is already implemented.
Comment 7 Jens Baumgart CLA 2012-02-21 10:53:46 EST
Fixed with commit 2f724143881b110bff53983df9ccf1d88366acc1.