Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335091 - Add merge options that command line git supports
Summary: Add merge options that command line git supports
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement with 11 votes (vote)
Target Milestone: 3.0   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 336933 351806 394432
Blocks:
  Show dependency tree
 
Reported: 2011-01-22 12:34 EST by Adalbert Homa CLA
Modified: 2013-07-01 04:36 EDT (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adalbert Homa CLA 2011-01-22 12:34:07 EST
Build Identifier: M20100909-0800, EGIT Jan 21 nightly build

Currently EGIT has no options when merging. Git command line supports --no-ff that instead of fast-forward will create an explicit commit for the merge.
This could be a general option so instead of the default fast forward behaviour create a merge commit all the time.

Reproducible: Always
Comment 1 Christian Halstrick CLA 2011-01-25 05:00:38 EST
I agree, that is a option we should make available to the end-user. Currently even the low-level merge commands doesn't support this option, but that's not so complicated to implement. We also have to think about how to present that options in the UI. Currently I like that I can merge another branch without any dialog popping up. Right-Click on a branch and say merge and EGit starts working. I would like to have this option to merge dialog-free and maybe add another entry to the menu "merge ..." which will present all the possible options of a merge.

Regarding a general option: does native git has an option which you would like to see EGit/JGit? If not it is not so likely that we introduce parameters which native git doesn't understand.
Comment 2 Adalbert Homa CLA 2011-01-25 09:03:49 EST
Hi Chris, thanks for considering this.
In native git you can set up merge options per branch:
As an example if you execute:
  $git config branch.master.mergeoptions "--no-ff --log --no-commit "

then every time when you merge to the master branch:
 a) a merge commit will be created every time 
 b) this commit will have one line comment from the log of each commit that was merged
 c) the merge operation will not auto-commit, it will let you review the changes

I agree you with you, native git and JGIT should speak the same language.
Comment 3 Eike Stepper CLA 2011-10-30 13:13:43 EDT
(In reply to comment #1)
> [...] Currently I like that I can merge another branch without any
> dialog popping up. Right-Click on a branch and say merge and EGit starts
> working. I would like to have this option to merge dialog-free and maybe add
> another entry to the menu "merge ..." which will present all the possible
> options of a merge.

I think this holds for a lot of operations. What about generally opening option dialogs if, e.g., the CTRL key is pressed while selecting an action with the mouse?
Comment 4 Alexander Weickmann CLA 2012-01-11 10:37:32 EST
Hi. The --no-commit option is extremely important to me.

Right now, I don't know a way how I could merge a patch branch into my master branch while being able to review the changes first. For example:

patch branch:
pom.xml: patchrepo

master branch:
pom.xml: masterrepo

Now merge patch branch to master branch. There will be no conflict, but the pom.xml may not be modified in master. I need a way to be able to review all changes before committing.

Currently, I do this by merging with the Git console using the --no-commit option. Then, in Eclipse I see all changes and then I can commit manually.
Comment 5 Christian Halstrick CLA 2012-01-17 06:58:14 EST
I proposed the JGit functionality for no-commit in http://egit.eclipse.org/r/#change,4945
Comment 6 Alexander Weickmann CLA 2012-03-26 15:57:46 EDT
How are you planning to integrate this into E-Git?

I've recently stumbled over a quite similar problem: Pushing with E-Git does not push branches up to the remote repository. For this, you have to go to the Git console and call git push --tags. As far as I can see, this is not possible with E-Git at all.

The git gui presents a checkbox to the user when pushing, allowing him to push tags as well for example.

I think it would be cool to have a dialog before operations like merge or push, that allow you to specific options via checkbox. So when you call a merge, you could check "no commit". Similar, when you call push, you could check "tags" ...
Comment 7 Alexander Weickmann CLA 2012-03-26 15:58:30 EDT
Sorry, I didn't mean branches, I mean tags.
Comment 8 Tomasz Zarna CLA 2013-04-04 10:24:32 EDT
Fixed in 545358577376bec8fc140a76ce0f72bf81cc0a94 which added support for --no-commit option.

I'm closing this one as fixed. Feel free to open new enhancement requests for other options.

Many thanks to Christian and Matthias for helping me to wrap this one up.
Comment 9 Robin Stocker CLA 2013-07-01 04:36:57 EDT
(In reply to comment #8)
> Fixed in 545358577376bec8fc140a76ce0f72bf81cc0a94 which added support for
> --no-commit option.
> 
> I'm closing this one as fixed. Feel free to open new enhancement requests
> for other options.

The above was about support in JGit. I opened bug 411978 for exposing --no-commit in the EGit UI.