-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add merging functionality and UI #600
Conversation
I would suggest creating a separate dialog. IMO one of the current design problems within this extension is that components tend to be shoehorned into serving multiple purposes, thus increasing code complexity and affecting maintainability. My preference would be components which are dedicated to single purposes. Here, that purpose would be to provide merge functionality. |
Thanks for the feedback, that makes sense to me. My reasoning for doing it this this way was to avoid replicating the filtering and branch selection and some of the styling. As this branch selection seems like the core shared feature of both of these dialogs. Would you suggest having an entirely separate widget that does its own listing and selection of branches? Or is it worth extracting parts that can be shared between the newBranch and merging dialogs? i.e. having a single component that displays lists of branches and incorporating that into both dialogs. |
Notebooks aren't great with regular git merge. You may want to consider integrating nbdime for the notebook merge: https://nbdime.readthedocs.io/en/latest/#why-is-nbdime-needed |
Smart laziness should drive developper work 😃 ; meaning make the code as modular as possible to avoid copy-paste (because you are copy-pasting bugs 😉). For ReactJS, this means composing component rather than inheriting (see the documentation). So creating small reusable component is the way to go.
|
@mlucool I think @ianhi just want to provide a way to carry a simple merge. Resolving conflict is a though business (although it will be a great addition). It should be carry out in subsequent PRs.
|
This is indeed my goal. You can configure git to use nbmerge as the merge driver for ipynb files. Unfortunately there does not seem to be a way to do this as an argument to git merge. Instead you need to modify a .gitattributes file or
Introducing changes to settings of a git repo seems a bit invasive. Maybe this extension could toggle this setting before doing a merge But I think it makes sense to limit this PR to just implementing standard git merge. |
Oops. clicked the wrong button. didn't intend to close |
creating backend for merge Update disabled button Make the text more informative + use transparency to indicate button as disabled. minor styling improvements made the mergeDialog box smaller + added a top border to the merge button in the panel so that it doesn't blend with the bottom branch when the bottom branch is selected.
090cd24
to
fc8d150
Compare
9d8fea1
to
4475f2c
Compare
ac1273a
to
0907221
Compare
Fix #310
This adds a button in all branch list item and in the Git menu to merge local branch into the current one.
Using the Git menu entry, the user will be prompted to select the branch to merge.
Original post
This PR is an attempt to implement a merging UI similar to what github desktop has. I don't think it's complete but wanted to put it here for any feedback so that if I'm going in the wrong direction I can stop that sooner rather than later. In particular, before I go about writing tests and such.
I drew pretty heavily from the github desktop UI, but didn't replicate their pre-emptive checking of if a merge is conflict free. Though this looks like it could be figured out with a series of git commands: https://stackoverflow.com/questions/501407/is-there-a-git-merge-dry-run-option
Here's the current UI, I think my one big worry is that was I was too invasive in modifying the existing
newBranchDialog
and should have just made a mergeDialog object. (To be clear the actual UI of thenewBranchDialog
is unchanged)Button in BranchMenu to trigger a dialog:
Dialog that pops up:
Before a branch is selected:
After a branch is selected:
merge conflict:
The error reporting here could definitely use some work. I think using something other than the default error box will allow for better listing of the files that were the problem.
merge settings
I just wrote the merge command as
git merge branch
and didn't play arround with the other arguments like-ff
. I also didn't try to extract the diff stat that merge ouputs in order to display it somewhere because this would have necessitated popping up another dialog.