Skip to content
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

Message Bus Engine v1 #60

Closed
wants to merge 18 commits into from
Closed

Message Bus Engine v1 #60

wants to merge 18 commits into from

Conversation

Vesper-arch
Copy link
Owner

No description provided.

@Vesper-arch Vesper-arch linked an issue Feb 9, 2024 that may be closed by this pull request
@Vesper-arch
Copy link
Owner Author

I am scared to resolve those conflicts because of what happened last time.

@Vesper-arch
Copy link
Owner Author

@miketwo How would I go about resolving the merge conflicts? Last time I had to create a sort of combination between the 2. That apparently messed up a lot of stuff as you saw when I tried to update the message bus branch with commits from main.

@miketwo
Copy link
Collaborator

miketwo commented Feb 9, 2024

Yeah merge conflicts suck, hah. I'll show you how I would do it.

In this case, you have only 1 commit on message_bus_engine, so a git rebase will do the trick. Rebase re-applies all the commits on a branch to a different starting point. We want to rebase onto main, so at the end it'll look like just 1 commit "on top" of main. Here's a picture (you can get this with the command gitk --all)

image

So from the message_bus_engine branch, you would do git rebase origin/main (assuming yours is called origin -- mine is called 'upstream' because I forked your code.)

That makes the conflicts appear in VSCode. You can edit the files to resolve the conflicts -- the "broken" files will be red. Here's a gif showing a bit of what that looks like:

example1

Once it's all cleaned up (and tests pass!), you do 2 commands:

  • git add -A (marks all broken files as resolved)
  • git rebase --continue (finishes the rebase)

Now you can update GitHub's copy of the branch by force pushing: git push origin message_bus_engine:message_bus_engine --force.

(Heads up that you almost never want to force push. One person force pushing breaks all other people's git pull on the branch that was pushed. This is a special case because there's only 2 people working on it and I know how to fix it on my end when git pull breaks.)

If you wanted to do it the more traditional way, it's almost the same. You do:

  • git merge main in place of git rebase main,
  • resolve all conflicts and git add them to mark resolved
  • git merge --continue
  • REGULAR (not force) push: git push origin message_bus_engine

@miketwo
Copy link
Collaborator

miketwo commented Feb 9, 2024

Also heads up that you want to find and remove pytest.mark.only so that all the tests run.

@miketwo
Copy link
Collaborator

miketwo commented Feb 9, 2024

And, generally-speaking, you probably want to accept the "INCOMING" changes, as those will correspond to your current branch. (It's weird and backwards-sounding).

@Vesper-arch
Copy link
Owner Author

I think I get it but I don't understand the gitk --all output. I'm just not sure how it displays the info or what logic it has.

@miketwo
Copy link
Collaborator

miketwo commented Feb 9, 2024

It's a visual representation of branches. Each dot is a commit. The yellow dot is the current commit. The lines show how the commits are connects. (Branches are "splits" and merges are "combines"). When you're done with the rebase, it should look something like this:
image

Just one commit on top of main.

@miketwo
Copy link
Collaborator

miketwo commented Feb 9, 2024

Let me know if you need help and I can resolve the conflicts for you. (Adding a message bus is hard enough without having to fight with git.)

@Vesper-arch
Copy link
Owner Author

Got it!

@Vesper-arch
Copy link
Owner Author

GitHub doesn't think so, I guess.

@Vesper-arch
Copy link
Owner Author

Vesper-arch commented Feb 10, 2024

I did the push command but git hub shows that its even more offset from main than before. Edit: And now when I do git rebase main again it shows the merge conflicts again

@miketwo
Copy link
Collaborator

miketwo commented Feb 10, 2024

Your local main is not up to date. That's why it's good to specify the Github's main ("origin"):

So from the message_bus_engine branch, you would do git rebase origin/main (assuming yours is called origin -- mine is called 'upstream' because I forked your code.)

On your main branch, you need to git pull. And now you've got a whole boatload of repeated commits to fix. Let me see if I can help...

@Vesper-arch
Copy link
Owner Author

I did git pull on both main and message_bus_engine and they both said that it was already up to date. Its only when I do git rebase origin/main on the message bus branch does it show those commits and the conflicts of course

@miketwo
Copy link
Collaborator

miketwo commented Feb 11, 2024

Hmm... That's strange. Ok. So where is the commit where you fixed all the conflicts? (Did you go through the broken files fixing them?) There's no way around that part of it.

@miketwo
Copy link
Collaborator

miketwo commented Feb 11, 2024

Ok. I pushed a branch (message_bus_fixed) that's just 1 commit on top of main, and is identical to the message_bus_engine branch. Feel free to switch to that branch if you want to avoid the conflicts.

@Vesper-arch
Copy link
Owner Author

Hmm... That's strange. Ok. So where is the commit where you fixed all the conflicts? (Did you go through the broken files fixing them?) There's no way around that part of it.

It should show as that group of 17 commits above. I did go through the rebasing for each of them.

@Vesper-arch
Copy link
Owner Author

Ok, I'm going to delete this one and make a new draft from the fixed branch. Thank you!

@Vesper-arch Vesper-arch deleted the message_bus_engine branch February 11, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use message bus engine system.
2 participants