Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360930 - Feature Request: Partial Staging
Summary: Feature Request: Partial Staging
Status: RESOLVED WORKSFORME
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 04:52 EDT by Matthias Brandt CLA
Modified: 2011-10-24 08:35 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot of git gui while selecting a line for commit. (14.02 KB, image/png)
2011-10-14 04:52 EDT, Matthias Brandt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Brandt CLA 2011-10-14 04:52:07 EDT
Created attachment 205183 [details]
Screenshot of git gui while selecting a line for commit.

Hi,

I like git very much because of its ability to make partial staging: When I finish a task, I can split my work into small commits. git-gui (Tcl) or GitX (Mac) both support this feature: You can choose, which lines of your files should be added to a commit.

Can you please implement this feature for EGit, too? I would be very happy, to use Git in my favourite IDE.
Comment 1 Remy Suen CLA 2011-10-14 09:01:55 EDT
When you open the 'Git Staging' view, you can open a compare editor and then move a diff from your working directory into the index. Does this satisfy your need?
Comment 2 Matthias Brandt CLA 2011-10-14 10:41:54 EDT
Cool! Thank you very much!
Comment 3 Matthias Brandt CLA 2011-10-24 06:11:44 EDT
Hi,

after working a little bit with the Staging View, i realized that you can only add a complete "change", but not single lines of this "change".

For example: You have added a function to a file, but you only want to commit the defintion, but not the body of this function.

This usecase is rare, i know. So you might set this feature as low-prio.
Comment 4 Remy Suen CLA 2011-10-24 07:49:58 EDT
(In reply to comment #3)
> after working a little bit with the Staging View, i realized that you can only
> add a complete "change", but not single lines of this "change".

This should be possible, Matthias.

1. Double-click on a file that has changes but is unstaged.
2. Use the tool item inside the compare editor to bring a change from the left to the right.
3. Ctrl+S to save.
4. That partial change should now be in the staged area.

Does this work for you?
Comment 5 Matthias Brandt CLA 2011-10-24 08:15:58 EDT
No: I can select single changes, but no single lines inside a change...
Comment 6 Remy Suen CLA 2011-10-24 08:20:39 EDT
(In reply to comment #5)
> No: I can select single changes, but no single lines inside a change...

Ah, okay, I see what you mean now. The editor on the right-hand side should be editable so you can copy/paste your single-line changes there as a temporary workaround.
Comment 7 Matthias Brandt CLA 2011-10-24 08:35:42 EDT
I see. This workaround is maybe enough, because the usecase is rare, in my opinion...