Closed iamthenoname closed 2 years ago
I'm a bit confused about what you're trying to do. I'm assuming you are in a git checkout of the linux kernel? The command you are running will try to merge the oasis source repository into the linux kernel, which doesn't make sense. They are separate repositories with no relation (that's what the error message fatal: refusing to merge unrelated histories
is trying to tell you).
The Kernel page in the wiki says to merge the oasis kernel branch:
git pull --no-edit https://github.com/oasislinux/linux
I think you must have just accidentally used the wrong URL. It's a good idea to try to understand what the commands do in the documentation rather than blindly running them. But if you do blindly run them, make sure you run the right commands.
Ah, sorry about that. I'll try to keep this in mind in the future. Thank you for replying
# git pull --no-edit https://github.com/oasislinux/linux
From https://github.com/oasislinux/linux
* branch HEAD -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
# git pull --no-edit https://github.com/oasislinux/linux --rebase
From https://github.com/oasislinux/linux
* branch HEAD -> FETCH_HEAD
(Merge is not a valid attribute name: .gitattributes:11
Auto-merging .clang-format
CONFLICT (add/add): Merge conflict in .clang-format
Auto-merging .gitattributes
CONFLICT (add/add): Merge conflict in .gitattributes
...(45480 lines)
Auto-merging virt/kvm/pfncache.c
CONFLICT (add/add): Merge conflict in virt/kvm/pfncache.c
Auto-merging virt/kvm/vfio.c
CONFLICT (add/add): Merge conflict in virt/kvm/vfio.c
error: could not apply 58390c8ce1... Merge tag 'iommu-updates-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 58390c8ce1... Merge tag 'iommu-updates-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
What tag are you trying to merge the oasis branch into? I'm surprised to see those conflicts, since the oasis branch doesn't modify those files.
You can either:
Ah, I see you used --rebase
. I suggest using --no-rebase
. Rebasing commits from years ago onto the latest kernel commits is not going to be very pleasant.
--no-rebase
causes a unrelated histories error, and with the allow of unrelated histories, the conflict occurs.
I will later today try building against 6.3.1, as I was on the latest commit. I would really appreciate if the oasislinux/linux had been updated though.
If there is unrelated histories error, something is wrong. Regardless of the commit you're merging into, the oasis branch will share a common parent commit with it. Maybe you used the wrong repository URL somewhere, or cloned with --depth 1
or something (so git didn't actually have the common commit, so couldn't find it)?
Yeah I cloned with --depth 1
because both cloning and fetching patches (half way through, canceled) took almost 10 minutes.
Why can't you convert the oasis 'patches' to simply patch files, and have the user get the tarball sources? i have a pretty fast internet; and even so it's extremely slow and unrealistic to clone an entire repository with it's history required for yet another operation that needs the entire kernel sources for simply patching, which is gigabytes big.
consider the following:
HEAD is now at a83b81b7392d Linux 6.3.1
bash-5.1# git pull --no-edit https://github.com/oasislinux/linux --no-rebase
From https://github.com/oasislinux/linux
* branch HEAD -> FETCH_HEAD
Auto-merging Makefile
Auto-merging arch/x86/Makefile
Auto-merging certs/Makefile
Auto-merging certs/extract-cert.c
CONFLICT (content): Merge conflict in certs/extract-cert.c
Auto-merging lib/Makefile
Auto-merging scripts/Makefile.host
Auto-merging scripts/kconfig/Makefile
Auto-merging scripts/kconfig/mconf-cfg.sh
CONFLICT (content): Merge conflict in scripts/kconfig/mconf-cfg.sh
Auto-merging tools/lib/api/Makefile
Auto-merging tools/lib/subcmd/Makefile
Auto-merging tools/objtool/Makefile
CONFLICT (content): Merge conflict in tools/objtool/Makefile
Auto-merging tools/objtool/elf.c
Auto-merging tools/perf/Makefile.perf
Automatic merge failed; fix conflicts and then commit the result.
Following the instructions in the wiki as-is, I got this error after pulling in the patches:
Using
pull.ff only
andpull.rebase false
did not work;Using
pull.rebase true
seems to run properly, until it runs into this error:Skipping it just brings up more errors like the one above