This is a Unity3D game in combination with git-lfs. Originally the
commit history looked something like this.
* Integrated Event System and Fine Tuned Files
* Finished Event System
* Initial Assets and Files Commit
* Initial Libraries Commit
* Initial Commit
The change I need to make as at file Assets/Scripts/AbstractComponent.cs
and consists of this patch
52 52 // Fire if marked and if events registered
53 53 if(fire && ChangeEvent != null)
54 - OnChange(name, value);
54 + ChangeEvent(name, value);
55 55 }
56 56
57 57 public void Notify(int name, object value = null)
58 58 {
59 59 if(NotifyEvent != null)
60 - OnNotify(name, value);
60 + NotifyEvent(name, value);
61 61 }
62 62
63 - protected void OnChange(int name, object value) {}
64 - protected void OnNotify(int name, object value) {}
63 + protected virtual void OnChange(int name, object value) {}
64 + protected virtual void OnNotify(int name, object value) {}
65 65 }
66 66
It was the only file that was modified so I stashed it with
git stash
then ran
git rebase -i <hash of Initial Assets and Files Commit>
From there I marked "edit"
on the commit in question causing rebase to
drop me in on that edit and then I ran
git stash apply
It applied just fine, no errors, no manual merging. Afterwards I amended
the commit using
git add Assets/Scripts/AbstractComponent.cs
git commit --amend
git reabse --continue
Afterwards I noticed a divergence that looked just like this
* Integrated Event System and Fine Tuned Files
* Finished Event System
| * Integrated Event System and Fine Tuned Files
| * Finished Event System
|/
* Initial Assets and Files Commit
* Initial Libraries Commit
* Initial Commit
Where the top 2 contain the original commits and the diverged part
containing the amended commit. Thats when I ran this command.
git rebase <hash of the diverged Finished Event System commit>
It then stopped on rebase commit 1 of 2 for a merge error basically of
the patch above so I hand fixed it and ran these commands.
git add Assets/Scripts/AbstractComponent.cs
git rebase --continue
It moved along fine with no errors and came out to be something like
this
* Integrated Event System and Fine Tuned Files
* Finished Event System
* Integrated Event System and Fine Tuned Files
* Finished Event System
* Initial Assets and Files Commit
* Initial Libraries Commit
* Initial Commit
I then did this command
git rebase -i <Hash of Initial Assets and Files Commit>
I re-arranged from this
pick Initial Assets and Files Commit
pick Finished Event System
pick Integrated Event System and Fine Tuned Files
pick Finished Event System
pick Integrated Event System and Fine Tuned Files
to this
pick Initial Assets and Files Commit
pick Finished Event System
squash Finished Event System
pick Integrated Event System and Fine Tuned Files
squash Integrated Event System and Fine Tuned Files
But there was a merge error of patch mentioned above that I hand-fixed
again the same way. The rebase continued on and brought me back to the
same tree.
* Integrated Event System and Fine Tuned Files
* Finished Event System
| * Integrated Event System and Fine Tuned Files
| * Finished Event System
|/
* Initial Assets and Files Commit
* Initial Libraries Commit
* Initial Commit
So restarted the whole process up until I was at this point
* Integrated Event System and Fine Tuned Files
* Finished Event System
* Integrated Event System and Fine Tuned Files
* Finished Event System
* Initial Assets and Files Commit
* Initial Libraries Commit
* Initial Commit
and rebased interactively but only did this
pick Initial Assets and Files Commit
pick Finished Event System
pick Finished Event System
pick Integrated Event System and Fine Tuned Files
pick Integrated Event System and Fine Tuned Files
just to get the order right before squashing. The rebase went smoothly
and looked like this
* Integrated Event System and Fine Tuned Files
* Finished Event System
* Initial Assets and Files Commit
* Initial Libraries Commit
* Initial Commit
Thats how it was suppose to look, glancing at the file I noticed the
file was completely reverted back to the way it was. So I ran these
commands
git rebase -i <Hash of Initial Assets and Files Commit>
and opted to edit the file by hand once again. I was frustrated then
so I made a mistake and edited it like this patch
52 52 // Fire if marked and if events registered
53 53 if(fire && ChangeEvent != null)
54 - OnChange(name, value);
54 + ChangeEvent(name, value);
55 55 }
56 56
57 57 public void Notify(int name, object value = null)
58 58 {
59 59 if(NotifyEvent != null)
60 - OnNotify(name, value);
60 + NotifyEvent(name, value);
61 61 }
62 62
63 63 protected void OnChange(int name, object value) {}
64 64 protected void OnNotify(int name, object value) {}
65 65 }
66 66
The last 2 lines I had forgotten to change. And then I saw this tree as well
* 2c935a7 (HEAD -> feature/event-system) Integrated Event System and Fine Tuned Files
* c579fde Finished Event System
| * ec6656e (origin/feature/event-system) Integrated Event System and Fine Tuned Files
| * ee51864 Finished Event System
|/
* 6fcbe87 (origin/develop, develop) Initial Assets and Files Commit
* f5015f8 Initial Libraries Commit
* 77f162a (origin/master, master) Initial Commit
And admitted defeat and sought to ask for help