Skip to content

linked worktrees unsupported when running build_docs #2883

Open

Description

@drewdaemon

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions