Git rebase is driving me out of my mind
#1
I am at the point where I want to submit a pull request. I have done this for several addons, but I was the only one doing development and the process was a bit different. I can do git basics, but there is still seems like a lot of voodoo. (I have used SCM systems for many years, but even though I have used git for well over a year, I don't use it daily and I do baby things with it. I can reset Head, use multiple remote branches (origin & upstream) (to some degree). But there are soooo many different ways to do the same thing that I get quite lost trying to grasp how it really works.

I've tried following Kodi git-Fu reference. I'm still needing very explicit instructions and find myself having to guess what to do a lot. Anyway, where things go to hell is when I try rebasing and fetch from upstream. Each time I do I I get conflicts. Fine. But I find that I get the same conflicts and same mountain of merges to do even though I have done it before, committed and pushed my changes up. It is EXTREEMLY tedious. I have started over with a new branch. No help.

I was all excited today because I thought I got all of the way through and pushed my changes to origin. Now I tried to merge the last 6 commits:

bacher@biten$ git status
On branch UnicodeUtils
Your branch is up to date with 'origin/UnicodeUtils'.

nothing to commit, working tree clean
fbacher@biten$ pwd
/scratch/git/xbmc

fbacher@biten$ git fetch upstream
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 19 (delta 6), reused 9 (delta 2), pack-reused 0
Unpacking objects: 100% (19/19), 22.89 KiB | 1019.00 KiB/s, done.
From https://github.com/xbmc/xbmc
   55cb6dfcf0..3868401d00  master     -> upstream/master
fbacher@biten$ git rebase upstream/master
Auto-merging xbmc/windows/GUIMediaWindow.cpp
Auto-merging xbmc/video/VideoInfoScanner.cpp
Auto-merging xbmc/video/VideoDatabase.cpp
Auto-merging xbmc/utils/URIUtils.cpp
Auto-merging xbmc/utils/StringUtils.h
CONFLICT (content): Merge conflict in xbmc/utils/StringUtils.h
Auto-merging xbmc/utils/StringUtils.cpp
CONFLICT (content): Merge conflict in xbmc/utils/StringUtils.cpp
Auto-merging xbmc/settings/SettingsComponent.cpp
Auto-merging xbmc/settings/AdvancedSettings.cpp
Auto-merging xbmc/platform/android/media/decoderfilter/MediaCodecDecoderFilterManager.cpp
Auto-merging xbmc/platform/android/activity/XBMCApp.cpp
Auto-merging xbmc/network/upnp/UPnPInternal.cpp
Auto-merging xbmc/interfaces/legacy/Window.cpp
Auto-merging xbmc/interfaces/builtins/SkinBuiltins.cpp
Auto-merging xbmc/guilib/GUIWindow.cpp
Auto-merging xbmc/guilib/GUIControlFactory.cpp
Auto-merging xbmc/cores/VideoPlayer/DVDSubtitles/webvtt/WebVTTHandler.cpp
Auto-merging xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
Auto-merging xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
Auto-merging xbmc/addons/Skin.cpp
Auto-merging xbmc/GUIInfoManager.cpp
Auto-merging xbmc/FileItem.cpp
Auto-merging xbmc/Application.cpp
Auto-merging CMakeLists.txt
error: could not apply f61a31b769... Merge with V20-alpha1
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply f61a31b769... Merge with V20-alpha1
fbacher@biten$ git rebase --abort

The first CONFLICT was in StringUtils, which I have indeed made lots of changes (working on Unicode Turkic-I problem, etc.). But I have applied the same blasted changes over and over and over and over in git and somehow it still has a conflict. I don't know what I am doing wrong. I know that once I get past these conflicts that I have 19 or so more iterations of rebase --continues to do and I'll have some very familiar conflicts on each one. Tedious conflicts.

To speed things up I have gotten desperate enough when using my merge tool (Beyond Compare) I simply select every line and choose merge left, remove all conflicts and save. Once I am all done I can compare with my stable copy that I have been very careful maintaining.

I realize this is an insufficient description. Tomorrow I'll record my every step and decision point. I just don't have the energy or 3 hours to do it now. I'm hoping somebody will have some sage advice that will put me on the right track.
Reply
#2
best would be to provide the branch you're trying to rebase on github
Reply
#3
https://github.com/fbacher/xbmc/tree/v20...icodeutils

I was able to complete a merge successfully and push my changes to github. According to Github it is not behind upstream. But on my local machine (which is synced with github) if I do
git rebase --upstream master

I get the blasted list of CONFLICTS which I thought that were resolved. Besides, why does it not realize that I am in sync with upstream? Must be that the frame of reference that git is using during rebase --upstream is wrong, or at least not in agreement with history.

This list of CONFLICTS looks worse than before.

fbacher@biten$ git remote -v
origin    https://github.com/fbacher/xbmc.git (fetch)
origin    https://github.com/fbacher/xbmc.git (push)
upstream    https://github.com/xbmc/xbmc.git (fetch)
upstream    https://github.com/xbmc/xbmc.git (push)

fbacher@biten$ git status
On branch v20alpha1_unicodeutils
Your branch is up to date with 'origin/v20alpha1_unicodeutils'.

nothing to commit, working tree clean

fbacher@biten$ git rebase upstream/master
Auto-merging xbmc/windows/GUIWindowLoginScreen.cpp
CONFLICT (content): Merge conflict in xbmc/windows/GUIWindowLoginScreen.cpp
Auto-merging xbmc/windows/GUIWindowDebugInfo.cpp
CONFLICT (content): Merge conflict in xbmc/windows/GUIWindowDebugInfo.cpp
Auto-merging xbmc/windows/GUIMediaWindow.cpp
CONFLICT (content): Merge conflict in xbmc/windows/GUIMediaWindow.cpp
Auto-merging xbmc/windowing/X11/XRandR.cpp
CONFLICT (content): Merge conflict in xbmc/windowing/X11/XRandR.cpp
Auto-merging xbmc/windowing/X11/WinSystemX11GLContext.cpp
CONFLICT (content): Merge conflict in xbmc/windowing/X11/WinSystemX11GLContext.cpp
Auto-merging xbmc/weather/WeatherJob.h
CONFLICT (content): Merge conflict in xbmc/weather/WeatherJob.h
Auto-merging xbmc/video/windows/GUIWindowVideoNav.cpp
CONFLICT (content): Merge conflict in xbmc/video/windows/GUIWindowVideoNav.cpp
Auto-merging xbmc/video/windows/GUIWindowVideoBase.cpp
CONFLICT (content): Merge conflict in xbmc/video/windows/GUIWindowVideoBase.cpp
... SNIP ...
CONFLICT (content): Merge conflict in xbmc/addons/Scraper.cpp
Auto-merging xbmc/addons/Repository.cpp
CONFLICT (content): Merge conflict in xbmc/addons/Repository.cpp
Auto-merging xbmc/addons/LanguageResource.cpp
CONFLICT (content): Merge conflict in xbmc/addons/LanguageResource.cpp
Auto-merging xbmc/addons/AddonVersion.cpp
CONFLICT (content): Merge conflict in xbmc/addons/AddonVersion.cpp
Auto-merging xbmc/Util.cpp
CONFLICT (content): Merge conflict in xbmc/Util.cpp
Auto-merging xbmc/URL.cpp
CONFLICT (content): Merge conflict in xbmc/URL.cpp
Auto-merging xbmc/GUIInfoManager.cpp
CONFLICT (content): Merge conflict in xbmc/GUIInfoManager.cpp
Auto-merging xbmc/FileItem.cpp
CONFLICT (content): Merge conflict in xbmc/FileItem.cpp
Auto-merging xbmc/Application.cpp
CONFLICT (content): Merge conflict in xbmc/Application.cpp
Auto-merging CMakeLists.txt
error: could not apply f61a31b769... Merge with V20-alpha1
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply f61a31b769... Merge with V20-alpha1
Reply
#4
I did find some major weirdness. I noticed that in the original branch for this effort, the remote branch was set to "origin/origin/v20alpha1_unicode". I pushed several times and everything seemed to be okay. But I can't find that branch on github, so I don't know where it was going. I have seen this once before and that time it did create a branch on github with the prefix "origin/" in front of the branch name. I must be more careful about creating these remote branches using "cola". Perhaps I should stick to command line for that particular operation.

Related to this is that after I started noticing the merge CONFLICT weirdness I validated my local git repository and there were complaints. It was failing git fsck. So I created another local repo and downloaded all of the branches anew from github. That is except for v20alpha_unicode, which I had already moved beyond (but it still was an ancestor branch).

Today, I pushed v20alpha_unicode to github (it wasn't there before due to the origin/origin issue). I then downloaded that branch to my new repository. I tried the git rebase again on a current branch. I did get several CONFLICTS, but not the mountain that I saw earlier today.

Having had enough of it all I created a new branch from upstream/master. I rolled back the HEAD to be a little earlier from my last push that I did (quite a painful operation to get around all of those conflicts). I then copied my changes over to this virgin branch, pushed it to origin. Finally, I did a rebase to upstream and it worked without any problems.  I don't know what was wrong, but I am hopeful that this cured it. In the mean time I'll spend some more quality time with this build to make sure that I didn't miss something in the manual merges, etc. One does get bleary eyed doing hundreds of manual merges. Fortunately the real code is in a handful of files. It is the thousand or so changes from "ToLower" to "ToFold" or similar changes that are mindless, but no less dangerous.

Let me know if you can think of something else for me to try.
Reply
#5
from a quick glance, the current state of the rebased branch is incorrect. It reverts recent commits, e.g. https://github.com/xbmc/xbmc/pull/21666
The reason is probably that you copied over the files.
Reply

Logout Mark Read Team Forum Stats Members Help
Git rebase is driving me out of my mind0