go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.91k stars 5.48k forks source link

[Feature Request] for Pull Request, Resolve Conflicts via WEB #9014

Open 6543 opened 4 years ago

6543 commented 4 years ago

this is part of #5158 summary ... and could be an addition of #9013

6543 commented 4 years ago

https://stackoverflow.com/a/6283843 this solution prints out the merge wich can be also displaied in our web editor to resolve this ... ?

maskym commented 4 years ago

I'm new to gitea, but it looks like this button (under GitHub) image
has no equivalent under gitea and I must solve PR manually ? Thanks

6543 commented 4 years ago

@UBowt571 until now ... yes :/

MarcelHillmann commented 4 years ago

+1

maskym commented 4 years ago

Is there someone already working on it ? I think about trying to implement it (I'm a noob and this would be my very first fork) but I don't want to do the same work as someone else did

guillep2k commented 4 years ago

@UBowt571 All contributions are welcome! 😄

brymut commented 4 years ago

I'll try to have a go at this other the next ~couple of days~. Sorry for the delay from when I said I would

nghtstr commented 4 years ago

+1

richmahn commented 4 years ago

@maskym @brymut I too may be working on this feature. Have either of you made any progress?

brymut commented 4 years ago

Go on @richmahn, I've lost track of this and won't be able to submit anything anytime soon

maskym commented 4 years ago

@richmahn Ho, go ahead, I surrendered (normal as a French guy lol) and switched to self-hosted gitlab instead I only managed to display a button but as I never worked in Go lang, the project was too big for me

richmahn commented 4 years ago

@maskym Haha. Loved the French joke. I've been working on Gitea and with Go since 2016, even the one who added the original web interface for editing files, so I should be able to do it. Thanks for the update!

MrHaroldA commented 3 years ago

We are investigating if Geany would be a viable alternative for the huge Gitlab installation we have running now, and the only real blocker we are seeing now is the lack of conflict resolving within the webinterface. This was mentioned in #14477 but lost traction and it never reached the 1.16 milestone.

@richmahn do you have any plans on implementing this? I have zero experience in coding for Gitea or Go, so I can't be of any help.

richmahn commented 3 years ago

@MrHaroldA Totally forgot I even mentioned I would work on this. Will put it on my todo list and see if I can take a stab at it in the coming week.

alexander-zierhut commented 2 years ago

@richmahn Still wish I had this feature sometimes for productivity sake 😆 By now, I had to learn git more in detail, can you imagine?

ktpx commented 2 years ago

I have a PR that now says 2 files are in conflic with the recieving repo., but i still see now way to resolve this... How in earths name can I now fix this? Local repo says everything is fine. Won't let me delete the PR either.

eUgEntOptIc44 commented 2 years ago

@richmahn any news on this?

6543 commented 2 years ago

@ktpx that's off topic ... but: merge target branch locally or rebase and push
PS: conflict detections do not work like merge - as it would be a merge otherwhise ...

richmahn commented 2 years ago

@eUgEntOptIc44 Sadly haven't had time to work on it, but have mentioned it to my team how badly it is needed. Hopefully can look at it soon, or if someone else wants to get this done, let me know. Should we do it exactly like Github does it, or have some extra functionality to making merging easier?

eUgEntOptIc44 commented 2 years ago

@richmahn thank you for your update on this. I'd like to directly support on this by contributing code. Unfortunately my knowledge of go is very limited. However I hope that you or someone else might be able to do so.

jayczech23 commented 2 years ago

@richmahn @eUgEntOptIc44 I am also interested in contributing to this feature that would be extremely helpful for my team's needs as well.

I would also mention that the way Github handles merge conflict would be a great baseline for an initial implementation.

Please let me know if available for collaboration on this much needed feature.

6543 commented 2 years ago

I'm not aware of any draft so I would say go on and it is yours ;) If you need help just ask. for the UI side I would have a look if it can be done in vue ... example: #19650 ...

richmahn commented 2 years ago

@jayczech23 I'm still needing this and keep playing around with getting this implemented like Github. Can we collaborate together?

richmahn commented 2 years ago

@jayczech23 Are you on the Gitea Discord server? If we could touch base there I would be far more likely to get to work on this and better communication since I do everything with Discord. https://discord.gg/mPWThBne

jayczech23 commented 2 years ago

@richmahn sounds great. I will sign up on the Gitea Discord and send you a message. Thanks!

alexander-zierhut commented 2 years ago

Would love to get an occasional update on this or even help out. I am on the Gitea Discord as well and tagged you @richmahn

richmahn commented 2 years ago

@jayczech23 @Alexander-Zierhut Ok, now I'm more clear on you both wanting to help. Awesome. I won't let this drop now. Would be a cool hack-a-thon. My work pays me to work on Gitea, but usually working on our own fork of it and then I merge in from upstream (Gitea). I have many coworkers who use our copy of Gitea for editing text files (content) rather than code.

A few things we need to figure out is first of all, I often get told when making a PR in Gitea that there is a conflict, due to different lines being edited, I think 2 apart, so the line between them still remains the same. This for some reason makes Gitea think there is a conflict. Yet if I merge master/main into the conflicting branch, it merges with no problem. That's one thing we need to solve....stop Gitea from declaring such a conflict (if it still is happening) as it is confusing.

Next is we need to mark up what a conflict editor UI should look like. Should it be just like Github, or something better?

richmahn commented 2 years ago

@jayczech23 @Alexander-Zierhut I have added you to a Github test repo so we can see how Github does it, mock up the Gitea, and implement all the different paths a user might take:

Accept the collaboration and see this PR:

https://github.com/richmahn/test/pull/3

richmahn commented 2 years ago

Here's a PR where the file was modified in base branch but deleted in the head branch. Github just says it is too complicated and says to deal with it on your computer. Wonder if there is a way we could deal with it in the UI?

https://github.com/richmahn/test/pull/4

richmahn commented 2 years ago

Ditto with a binary file: https://github.com/richmahn/test/pull/5

richmahn commented 2 years ago

Large file with conflicts: https://github.com/richmahn/test/pull/6/conflicts

richmahn commented 2 years ago

If we make it exactly like Github we can then just copy their help pages:

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line

(Maybe the last one Gitea already has?)

richmahn commented 2 years ago

So basically the base branch is being merged into the head branch to get the conflicts and the diff and then when the user submits the changes it updates with head branch with the base branch and fixes the conflicts. I wonder what the caveats are in doing this, such as as what if either branches are edited and pushed while the user is making their conflict resolution changes, if a temporary branch should be made to work from, etc. Thoughts? How do we properly map this out git-wise, gitea-wise and UI-wise? Do we lock the head branch or something? I wonder what Github does to handle conflict resolution and new changes while it is being done.

xuanswe commented 1 year ago

For simple conflicts, especially for writing documentation or books, this feature is really useful. In these cases, I really don't want to wait until I can open my IDE to solve simple conflicts.

NatashaCyn commented 1 year ago

@ richmahn , any news with this issue? Do u need a help

richmahn commented 1 year ago

@NatashaCyn Funny, I just thought about the dire need my organization has for this feature, yet I still haven't gotten to it. I really would like there to be a 2-3 of us working on this...not that I couldn't program it, as I even made the file editor/committer for Gogs/Gitea interface (the original anyway, I'm sure it has been refactored), but to make sure we are doing it right, both how Github does, but also maybe in a way that could improve on that, would be great to have others working on it.

richmahn commented 1 year ago

@NatashaCyn I'm trying to get my company's fork and codebase up-to-date with Gitea 1.19.3 and release it. Once that is done, hopefully I can look more at the conflict resolver.

richmahn commented 1 year ago

Ok, getting my company fork updated from v1.20, lol. Pretty much done.

ijustlovemath commented 1 year ago

Just wanted to add that this feature would be fantastic! If implementation hasn't started yet, I'd like to say I love how clear the IntelliJ/PyCharm style of merge conflict resolution is:

image

The sweet part about this implementation is two-fold:

  1. Good labelling ("Your version", "Result", "Changes from ")
  2. The little >> button (next to line numbers) to say "I want this change from this version", which basically lets you build the exact set of changes that you want

Unfortunately not a Go coder, but definitely following along in case there's anything minor I can contribute!

richmahn commented 1 year ago

@ijustlovemath Yeah, I agree, that looks great. Wonder how well to do it in a web interface though.

ijustlovemath commented 1 year ago

The main challenge with any sort of conflict resolution UI will always be horizontal space. As long as there's a synchronized horizontal scrollbar and a minimum about of horizontal space (enough room for 90/150/180/240 columns + surrounding UI), it should be workable!

This type of interface probably leaves mobile users out to dry, but I wonder how many people are trying to do complex merge conflict resolution on their mobile devices to begin with

Another alternative could be to do it in stages, eg "select changes from your version", "select changes from remote version", "final review", which you could do in some kind of tabbed UI, but then you lose the clarity of having the full picture laid out before you.

Interested to hear any thoughts from others!

alexander-zierhut commented 1 year ago

The main challenge with any sort of conflict resolution UI will always be horizontal space. As long as there's a synchronized horizontal scrollbar and a minimum about of horizontal space (enough room for 90/150/180/240 columns + surrounding UI), it should be workable!

This type of interface probably leaves mobile users out to dry, but I wonder how many people are trying to do complex merge conflict resolution on their mobile devices to begin with

Another alternative could be to do it in stages, eg "select changes from your version", "select changes from remote version", "final review", which you could do in some kind of tabbed UI, but then you lose the clarity of having the full picture laid out before you.

Interested to hear any thoughts from others!

For the mobile users and quick fixes in general: How about a quick "Accept all incoming changes" and "Accept all local changes"

puni9869 commented 1 year ago

I am excited to see this. @yardenshoham thanks for accepting this.

yardenshoham commented 1 year ago

Just to clarify, I think this is a good idea. I don't plan on implementing it personally.

richmahn commented 1 year ago

@yardenshoham It's all yours!

haha. I know that. I don't mind doing it myself. I just need to find time as it is on my comapny's time the work I put into Gitea.

makar112233 commented 8 months ago

+1

CelaniDe commented 8 months ago

hello guys, any news on this?

algora-pbc[bot] commented 8 months ago

💎 $600 bounty • CommitGo, Inc.

Steps to solve:

  1. Start working: Comment /attempt #9014 with your implementation plan
  2. Submit work: Create a pull request including /claim #9014 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to go-Gitea/gitea!

Add a bounty • Share on socials

Attempt Started (GMT+0) Solution
🟢 @oliverqx Mar 26, 2024, 11:52:55 PM WIP
🟢 @richmahn Apr 3, 2024, 5:30:13 PM WIP
techknowlogick commented 8 months ago

That was me ^ I'm testing the linked platform for bounties since bounty source went awol

oliverqx commented 7 months ago

/attempt #9014

Algora profile Completed bounties Tech Active attempts Options
@oliverqx 6 bounties from 3 projects
TypeScript, Python
Cancel attempt