Skip to content
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

linked worktrees unsupported when running build_docs #2883

Open
drewdaemon opened this issue Jan 5, 2024 · 0 comments
Open

linked worktrees unsupported when running build_docs #2883

drewdaemon opened this issue Jan 5, 2024 · 0 comments

Comments

@drewdaemon
Copy link

This is a bit of an edge case, but documenting it here for the benefit of any future folks who may run into this issue.

If build_docs is pointed at an ascii-doc index file in a linked git worktree, it fails to identify the correct root directory for the git repo, leading to cascading failures.

STR

  • clone Kibana
  • from within the Kibana root directory, run git worktree add ../linked-kibana-worktree
  • cd ../linked-kibana-worktree
  • path/to/docs/repo/build_docs --doc ./docs/index.asciidoc

Result

INFO:build_docs:Building HTML from /doc/linked-kibana-worktree/docs/index.asciidoc
INFO:build_docs:Couldn't find repo toplevel for /doc/linked-kibana-worktree/docs
INFO:build_docs:Guessed toplevel=[/doc/linked-kibana-worktree/docs] remote=[0] branch=[master] repo=[repo]
...

Under the hood, the rev-parse command is failing with the following error (which is silenced in the current script).

INFO:build_docs:Error executing: git rev-parse --show-toplevel
INFO:build_docs:---out---
INFO:build_docs:
INFO:build_docs:---err---
INFO:build_docs:fatal: not a git repository: path/to/kibana/.git/worktrees/linked-kibana-worktree

This causes $toplevel to be empty and the script makes an incorrect guess and fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant