Bug 416549 - Fetch from Gerrit could offer to only apply the fetched change(s) to index
Summary: Fetch from Gerrit could offer to only apply the fetched change(s) to index
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-04 12:44 EDT by Eike Stepper CLA
Modified: 2013-09-30 14:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2013-09-04 12:44:15 EDT
I'm always puzzled when I look at all the possible choices of the Fetch dialog. Especially the meaning of "Update FETCH_HEAD only" is a little unclear, given that all choices are labeled as "Action to perform *after* fetch", so that I'd expect the FETCH_HEAD to be updated already at that time. It probably should say "None". But I may be wrong and this is not what I'm going to ask for ;-)

Personally I'm very used to work with the staging view. It always shows a nice overview of all changed files and my text editors can nicely display the quick diff annotations that make reviewing so easy. Would it be possible to add a choice to the Fetch dialog, in analogy to Gerrit's web UI, that applies the changeset as a patch?

Like for example this:

git fetch ssh://estepper@git.eclipse.org:29418/cdo/cdo refs/changes/86/16086/2 && git format-patch -1 --stdout FETCH_HEAD | git apply
Comment 1 Eike Stepper CLA 2013-09-04 12:51:18 EDT
Thinkning about it once more, I get the impression that local branch or tag creation is kind of orthogonal and could be useful for the patch application, too. I mean, at some point I need to commit/push the changes and all too often it happens that I accidentally commit to, e.g., master.
Comment 2 Sam Davis CLA 2013-09-27 16:47:31 EDT
This is an interesting idea. I'm moving it to EGit since that's where the dialog comes from. Personally I probably wouldn't use this since it would require committing my local changes first - in fact the option should come with a warning if you have uncommitted changes. I think I would rather have the option to open the workspace version of a file from the review.
Comment 3 Robin Stocker CLA 2013-09-28 05:03:09 EDT
Am I understanding that right that you want the fetched change to be only applied to the index? There are a few open questions/problems with that:

- This would lose the commit message
- What if there was more than one change fetched (change dependency)? Apply them squashed?

Or do you want an option to `git am` the change(s) to the current branch?

By the way, regarding quick diff, are you aware that you can set the quick diff baseline to a commit in the history view?
Comment 4 Sam Davis CLA 2013-09-30 14:52:48 EDT
I don't know if the commit message matters in this use case, but I suppose the commit dialog and staging view could be auto-populated with the message from the fetched commit.