oasislinux / oasis

a small statically-linked linux system
Other
2.75k stars 84 forks source link

commit.sh fatal: Not a valid object name tree #23

Closed faithanalog closed 3 years ago

faithanalog commented 3 years ago

I'm following https://github.com/oasislinux/oasis/wiki/Install

I did the instructions of git init from the oasis template in root, setting this config, and running ninja commit

repo={
    path='../..',
    flags='',
    tag='tree',
    branch='oasis',
}

at the end of the build, I'm getting this error:

[1/1] sh ./scripts/commit.sh ../.. oasis tree out/root.commit
FAILED: out/root.commit
sh ./scripts/commit.sh ../.. oasis tree out/root.commit
fatal: Not a valid object name tree
ninja: build stopped: subcommand failed.

the specific line in commit.sh that's failing is https://github.com/oasislinux/oasis/blob/00af93b9625f1c0394f7ea0e869e85713484a198/scripts/commit.sh#L26

I tried creating the oasis branch (root is on master) and then creating an inital commit and tagging it "tree". That did get this command to not error, but it didn't actually help anything because the subsequent merge instructions failed from master, stating oasis was not something that can be merged.

Anyway I'm not enough of a git witch to understand what's actually supposed to be happening to debug this.

michaelforney commented 3 years ago

I'm not exactly sure what happened to get into this state.

Here's how it works:

Can you try deleting the tree tag in the root repository git tag -d tree, removing out/root.tree, and then running ninja commit again?

That did get this command to not error, but it didn't actually help anything because the subsequent merge instructions failed from master, stating oasis was not something that can be merged.

This is also confusing to me. If ninja commit succeeded, then it wrote a branch called oasis (or whatever config.repo.branch was set too). That error indicates that there is no such branch. Are you sure you ran the git merge from the same repository that config.repo.path points to?

faithanalog commented 3 years ago

ok yeah i have no idea what happened last night to get it into that state either. Just now I

and that worked just fine, as did the merge. Thanks for explaining what's going on.