-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of repo checkouts created by GIT worktree command #107
Comments
Kas includes are always repo-relative, referring to the root of the repo they are in. Maybe that helps already? Otherwise, we may need some set of config files to reproduce. |
OK, I don't think its a problem of the config files or if includes are used. |
Cannot confirm, even when using a kas file that comes with includes. |
I am having the same issue @steerpike68 describes. I think I may have found the reason: The
which will not be available inside the kas container as it only mounts the linked worktree to We're seeing the error message because then Line 232 in 6626154
This will work fine in situations where kas is started from the toplevel of the repo but not when it is started from a subdirectory. Not sure if we can work around this sensibly as we'd need some hacky additional mounts into the container to make that |
Git support sharing the .git directory across multiple worktrees each having its own HEAD, index, rebase-todo and so on. The worktree directory (created with `git worktree`) contains no directory .git, but a file .git with a reference to the main git directory. Therefore, this directory must also be mounted in the container to make git operable. [Felix] Git uses an absolute path to anchor the worktrees to the common repository. As we do not want to recreate the full host path inside the container, we mount the common repo as /repo-common and patch the .git file of the worktree to point to that instead of the path on the host. This is implemented using a temporary .git file with the patched path. By that, the worktree on the host is kept unchanged. Closes: siemens#107 Signed-off-by: Jörg Sommer <[email protected]> Signed-off-by: Felix Moessbauer <[email protected]>
When I checkout a KAS/Yocto based GIT repo branch into a working folder using the GIT worktree feature, the build fails at an early stage:
$ kas/kas-container -v --ssh-dir ${HOME}/.ssh build kas/project-latest.yml
2023-11-30 10:40:40 - INFO - kas 4.0 started
2023-11-30 10:40:40 - DEBUG - Using selector: EpollSelector
2023-11-30 10:40:40 - INFO - /repo/kas$ git rev-parse --show-toplevel
2023-11-30 10:40:40 - INFO - /repo/kas$ hg root
2023-11-30 10:40:40 - INFO - /repo/kas$ git rev-parse --show-toplevel
2023-11-30 10:40:40 - INFO - /repo/kas$ hg root
2023-11-30 10:40:40 - DEBUG - execute setup_dir
2023-11-30 10:40:40 - DEBUG - execute setup_home
2023-11-30 10:40:40 - DEBUG - execute init_setup_repos
2023-11-30 10:40:40 - ERROR - Configuration file not found: /repo/kas/kas/includes/default-config.yml
I've replaced the name of my local worktree folder with <worktreefolder> in the command above. This path/folder contains a .git file which is pointing to the main repo this worktree is based upon. I assume that the current kas version instead expects a .git folder.
When I instead create the local folder by cloning the repo and checkout the correct branch, the same command works fine.
The text was updated successfully, but these errors were encountered: