mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-19 12:42:26 +00:00
Add comprehensive rebase instructions for PR #40
Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
parent
637d6e85c7
commit
0e15b58ba9
142
REBASE_INSTRUCTIONS.md
Normal file
142
REBASE_INSTRUCTIONS.md
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
# Instructions to Resolve PR #40 Merge Conflicts
|
||||||
|
|
||||||
|
## Current Situation
|
||||||
|
|
||||||
|
**Problem:** PR #40 has merge conflicts because:
|
||||||
|
- Your PR branch (`copilot/sub-pr-39`) is at commit `6e2a9a4` (old state)
|
||||||
|
- The base branch (`fix/buff-suppression-pet-restore`) has moved forward to commit `b19503a`
|
||||||
|
- The base branch now includes fixes that were in your PR, causing conflicts
|
||||||
|
- GitHub shows the PR as not mergeable (`mergeable: false`, `mergeable_state: "dirty"`)
|
||||||
|
|
||||||
|
**Why this happened:** The base branch was updated with the `return false;` → `return;` fix and nimbus effect restoration that were originally part of your PR. Now those commits are redundant and causing conflicts.
|
||||||
|
|
||||||
|
## Solution: Rebase Your Branch
|
||||||
|
|
||||||
|
You need to rebase your PR branch onto the latest base branch. This will:
|
||||||
|
1. Remove redundant commits that are now in the base branch
|
||||||
|
2. Keep only the Levitate restoration feature
|
||||||
|
3. Resolve all conflicts
|
||||||
|
|
||||||
|
## Step-by-Step Instructions
|
||||||
|
|
||||||
|
### Option 1: Manual Rebase (Recommended)
|
||||||
|
|
||||||
|
Run these commands in your local repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Make sure you're on the PR branch
|
||||||
|
git checkout copilot/sub-pr-39
|
||||||
|
|
||||||
|
# 2. Fetch the latest changes
|
||||||
|
git fetch origin
|
||||||
|
|
||||||
|
# 3. Rebase onto the latest base branch
|
||||||
|
git rebase origin/fix/buff-suppression-pet-restore
|
||||||
|
|
||||||
|
# 4. When git reports a conflict in the validation check, skip it (it's redundant)
|
||||||
|
# Git will show a conflict like:
|
||||||
|
# <<<<<<< HEAD
|
||||||
|
# if (!IsValidSpell(buffs[slot].spellid))
|
||||||
|
# return;
|
||||||
|
# =======
|
||||||
|
# if (!IsValidSpell(buffs[slot].spellid)) {
|
||||||
|
# return;
|
||||||
|
# }
|
||||||
|
# >>>>>>> (your commit)
|
||||||
|
#
|
||||||
|
# Skip this commit since the base already has the fix:
|
||||||
|
git rebase --skip
|
||||||
|
|
||||||
|
# 5. Git will automatically drop the "Resolve merge conflict" commit
|
||||||
|
# The rebase should complete successfully
|
||||||
|
|
||||||
|
# 6. Force-push the rebased branch
|
||||||
|
git push --force-with-lease origin copilot/sub-pr-39
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2: Using GitHub CLI
|
||||||
|
|
||||||
|
If you have GitHub CLI installed:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Update the PR branch
|
||||||
|
gh pr checkout 40
|
||||||
|
git fetch origin
|
||||||
|
git rebase origin/fix/buff-suppression-pet-restore
|
||||||
|
git rebase --skip # When prompted about the validation conflict
|
||||||
|
git push --force-with-lease origin copilot/sub-pr-39
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 3: Reset and Cherry-pick
|
||||||
|
|
||||||
|
If the rebase seems complicated, you can reset to the base and cherry-pick only the Levitate commit:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Fetch latest
|
||||||
|
git fetch origin
|
||||||
|
|
||||||
|
# 2. Create a backup of your current branch
|
||||||
|
git branch copilot/sub-pr-39-backup
|
||||||
|
|
||||||
|
# 3. Reset your branch to the base
|
||||||
|
git checkout copilot/sub-pr-39
|
||||||
|
git reset --hard origin/fix/buff-suppression-pet-restore
|
||||||
|
|
||||||
|
# 4. Cherry-pick only the Levitate restoration commit (03f7704)
|
||||||
|
git cherry-pick 03f7704
|
||||||
|
|
||||||
|
# 5. Force-push
|
||||||
|
git push --force-with-lease origin copilot/sub-pr-39
|
||||||
|
```
|
||||||
|
|
||||||
|
## Expected Result
|
||||||
|
|
||||||
|
After successful rebase, your branch will have:
|
||||||
|
- **2 commits** total:
|
||||||
|
- Initial plan commit
|
||||||
|
- Levitate restoration commit
|
||||||
|
- **Base:** `fix/buff-suppression-pet-restore` at commit `b19503a`
|
||||||
|
- **No conflicts** - the PR will be mergeable
|
||||||
|
|
||||||
|
The validation fix and nimbus restoration will be inherited from the base branch, not part of your PR's changes.
|
||||||
|
|
||||||
|
## What Changed
|
||||||
|
|
||||||
|
### Before Rebase:
|
||||||
|
- 4 commits in your PR
|
||||||
|
- Includes validation fix (`return false;` → `return;`)
|
||||||
|
- Includes merge conflict resolution commit
|
||||||
|
- Conflicts with base branch
|
||||||
|
|
||||||
|
### After Rebase:
|
||||||
|
- 2 commits in your PR
|
||||||
|
- Only Levitate restoration feature
|
||||||
|
- Clean history based on latest base branch
|
||||||
|
- No conflicts
|
||||||
|
|
||||||
|
## Files Affected
|
||||||
|
|
||||||
|
Your PR will only modify:
|
||||||
|
- `zone/spell_effects.cpp` - Lines 4722-4735 (Levitate case added to switch statement)
|
||||||
|
|
||||||
|
## Need Help?
|
||||||
|
|
||||||
|
If you encounter issues:
|
||||||
|
1. Check that you're on the correct branch: `git branch`
|
||||||
|
2. Verify the base branch SHA: `git ls-remote origin fix/buff-suppression-pet-restore`
|
||||||
|
3. If stuck during rebase: `git rebase --abort` to start over
|
||||||
|
4. Check the PR status: https://github.com/Valorith/Server/pull/40
|
||||||
|
|
||||||
|
## Additional Notes
|
||||||
|
|
||||||
|
- **Why `--force-with-lease`?** This is safer than `--force` because it won't overwrite the remote branch if someone else pushed to it
|
||||||
|
- **Why skip the validation commit?** The base branch already has `return;` (correct), so your commit adding the same fix is redundant
|
||||||
|
- **Is this safe?** Yes, rebasing removes redundant commits while keeping your Levitate feature intact
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
After pushing, verify on GitHub:
|
||||||
|
1. Go to https://github.com/Valorith/Server/pull/40
|
||||||
|
2. Check that "This branch has no conflicts with the base branch" appears
|
||||||
|
3. Verify only 2 commits are shown
|
||||||
|
4. Confirm the changes show only the Levitate restoration code
|
||||||
157
REBASE_VISUAL_GUIDE.md
Normal file
157
REBASE_VISUAL_GUIDE.md
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
# Visual Guide: PR #40 Rebase Process
|
||||||
|
|
||||||
|
## Current State (BEFORE Rebase)
|
||||||
|
|
||||||
|
```
|
||||||
|
fix/buff-suppression-pet-restore (base branch)
|
||||||
|
│
|
||||||
|
├─ b19503a ← Merge PR #42 (includes return; fix)
|
||||||
|
│ ├─ 4faf48a ← Merge PR #43 (includes return; fix)
|
||||||
|
│ ├─ ff7dbce ← Fix compilation: return false → return
|
||||||
|
│ └─ ...more commits with validation fixes
|
||||||
|
│
|
||||||
|
└─ dffc461 ← Old base (what your PR was originally based on)
|
||||||
|
│
|
||||||
|
└─ copilot/sub-pr-39 (your branch) ← CONFLICTS HERE!
|
||||||
|
├─ 6e2a9a4 ← Resolve merge conflict
|
||||||
|
├─ 597e6eb ← Add validation check (return;)
|
||||||
|
├─ 03f7704 ← Add Levitate restoration ✓ (THIS IS WHAT WE WANT)
|
||||||
|
└─ 950e644 ← Initial plan
|
||||||
|
```
|
||||||
|
|
||||||
|
**Problem:** Your commits 597e6eb and 6e2a9a4 add the same fix that's already in b19503a!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## After Rebase (TARGET State)
|
||||||
|
|
||||||
|
```
|
||||||
|
fix/buff-suppression-pet-restore (base branch)
|
||||||
|
│
|
||||||
|
├─ b19503a ← Merge PR #42 (includes return; fix & nimbus)
|
||||||
|
│ ├─ 4faf48a ← Merge PR #43
|
||||||
|
│ ├─ ff7dbce ← Fix compilation
|
||||||
|
│ └─ ...
|
||||||
|
│
|
||||||
|
└─ copilot/sub-pr-39 (your branch - rebased) ← CLEAN!
|
||||||
|
├─ f94cb8d ← Add Levitate restoration ✓
|
||||||
|
└─ dee427b ← Initial plan
|
||||||
|
```
|
||||||
|
|
||||||
|
**Result:** Clean history with only your Levitate feature!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What the Rebase Does
|
||||||
|
|
||||||
|
### Step 1: Replay Your Commits
|
||||||
|
```
|
||||||
|
git rebase origin/fix/buff-suppression-pet-restore
|
||||||
|
```
|
||||||
|
Git attempts to replay your commits on top of b19503a:
|
||||||
|
- ✓ 950e644 (Initial plan) → dee427b
|
||||||
|
- ⚠️ 597e6eb (Add validation) → **CONFLICT** (already in base)
|
||||||
|
- ⏭️ Skip this commit with: `git rebase --skip`
|
||||||
|
- ⏭️ 6e2a9a4 automatically dropped (contents already upstream)
|
||||||
|
- ✓ 03f7704 (Add Levitate) → f94cb8d
|
||||||
|
|
||||||
|
### Step 2: Force Push
|
||||||
|
```
|
||||||
|
git push --force-with-lease origin copilot/sub-pr-39
|
||||||
|
```
|
||||||
|
Updates the remote branch with the clean history.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## The Conflict Explained
|
||||||
|
|
||||||
|
When rebasing, Git will show:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
<<<<<<< HEAD (base branch - what's already there)
|
||||||
|
if (!IsValidSpell(buffs[slot].spellid))
|
||||||
|
return;
|
||||||
|
=======
|
||||||
|
if (!IsValidSpell(buffs[slot].spellid)) { (your commit - same fix!)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
>>>>>>> 597e6eb (Add validation check)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Both sides have `return;`** - just different formatting!
|
||||||
|
Since the base already has the fix, skip your commit: `git rebase --skip`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Commit Details
|
||||||
|
|
||||||
|
### Your Levitate Commit (03f7704)
|
||||||
|
This is the ONLY commit that should remain in your PR:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
case SpellEffect::Levitate:
|
||||||
|
{
|
||||||
|
if (!zone->CanLevitate()) {
|
||||||
|
SendAppearancePacket(AppearanceType::FlyMode, 0);
|
||||||
|
BuffFadeByEffect(SpellEffect::Levitate);
|
||||||
|
} else {
|
||||||
|
if (spell.limit_value[i] == 1) {
|
||||||
|
SendAppearancePacket(AppearanceType::FlyMode,
|
||||||
|
EQ::constants::GravityBehavior::LevitateWhileRunning);
|
||||||
|
} else {
|
||||||
|
SendAppearancePacket(AppearanceType::FlyMode,
|
||||||
|
EQ::constants::GravityBehavior::Levitating);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Location: `zone/spell_effects.cpp` lines 4722-4735
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Quick Reference Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# The complete rebase process
|
||||||
|
git checkout copilot/sub-pr-39
|
||||||
|
git fetch origin
|
||||||
|
git rebase origin/fix/buff-suppression-pet-restore
|
||||||
|
# When conflict appears:
|
||||||
|
git rebase --skip
|
||||||
|
# After rebase completes:
|
||||||
|
git push --force-with-lease origin copilot/sub-pr-39
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### If rebase fails with different error:
|
||||||
|
```bash
|
||||||
|
git rebase --abort
|
||||||
|
# Try again or use Option 3 (cherry-pick)
|
||||||
|
```
|
||||||
|
|
||||||
|
### To see what will change:
|
||||||
|
```bash
|
||||||
|
git log origin/fix/buff-suppression-pet-restore..HEAD --oneline
|
||||||
|
```
|
||||||
|
|
||||||
|
### To verify base branch:
|
||||||
|
```bash
|
||||||
|
git fetch origin
|
||||||
|
git show origin/fix/buff-suppression-pet-restore:zone/spell_effects.cpp | grep -A3 "IsValidSpell"
|
||||||
|
# Should show: if (!IsValidSpell(buffs[slot].spellid))
|
||||||
|
# return;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Why This is Safe
|
||||||
|
|
||||||
|
1. **Your Levitate code is preserved** - The commit 03f7704 will be replayed as-is
|
||||||
|
2. **No data loss** - Redundant commits are removed because they're already in base
|
||||||
|
3. **Cleaner history** - Removes duplicate/conflicting commits
|
||||||
|
4. **PR becomes mergeable** - No conflicts after rebase
|
||||||
|
|
||||||
|
The validation fix you added is not lost - it's already in the base branch!
|
||||||
Loading…
x
Reference in New Issue
Block a user