Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 297265 - Stop prompting user to amend previous commit if no previous commits exist -- patch submission
Summary: Stop prompting user to amend previous commit if no previous commits exist -- ...
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-08 15:12 EST by Charley Wang CLA
Modified: 2010-02-07 14:16 EST (History)
3 users (show)

See Also:


Attachments
Patch for the above (1.96 KB, application/octet-stream)
2009-12-08 15:12 EST, Charley Wang CLA
no flags Details
Proposed patch for the above (1.96 KB, application/octet-stream)
2009-12-10 10:02 EST, Charley Wang CLA
no flags Details
Patch with expanded error message (2.56 KB, text/plain)
2010-02-01 17:01 EST, Charley Wang CLA
caniszczyk: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Charley Wang CLA 2009-12-08 15:12:06 EST
Created attachment 154053 [details]
Patch for the above

Currently if I create a new git repo, right-click the project folder, and click
'Commit...' without adding anything to version control, I will be told that no
files were selected and asked if I wish to amend a previous commit.

However, there are no previous commits. The proposed patch moves up a call to
loadPreviousCommit so that EGit can tell in advance whether or not a previous
commit is available. It is up to you whether or not to keep the error message
about amends not possible in this case, I have left it in.

Sorry for not using Gerrit, but your wiki claims that submitting a patch this
way is also okay? Please feel free to let me know if I have committed any faux
pas. :) 

-Charley
Comment 1 Mykola Nikishov CLA 2009-12-10 03:03:22 EST
(In reply to comment #0)
> However, there are no previous commits. The proposed patch moves up a call to
> loadPreviousCommit so that EGit can tell in advance whether or not a previous
> commit is available. It is up to you whether or not to keep the error message
> about amends not possible in this case, I have left it in.

Thank you, Charley. It seems ok, but I'll take a closer look at it later today.

> Sorry for not using Gerrit, but your wiki claims that submitting a patch this
> way is also okay?

In most cases it's true. But not when it has not been marked as a patch and it's MIME Type is 'application/octet-stream' instead of 'plain/text';-)
Comment 2 Charley Wang CLA 2009-12-10 10:02:30 EST
Created attachment 154243 [details]
Proposed patch for the above

Apologies :) here it is in plain text.
Comment 3 Matthias Sohn CLA 2009-12-15 20:41:34 EST
Charley: I uploaded your change to Gerrit for easier review: http://egit.eclipse.org/r/#change,142

Please register here to participate in the code review :
http://egit.eclipse.org/register

--
Matthias
Comment 4 Charley Wang CLA 2010-02-01 17:01:42 EST
Created attachment 157848 [details]
Patch with expanded error message

Slight modification to the error message produced.
Comment 5 Chris Aniszczyk CLA 2010-02-07 14:16:05 EST
Pushed.