Skip to content

Support a .worktreeinclude file#490

Open
matthewbauer wants to merge 2 commits into
xenodium:mainfrom
matthewbauer:add-worktree-include-file
Open

Support a .worktreeinclude file#490
matthewbauer wants to merge 2 commits into
xenodium:mainfrom
matthewbauer:add-worktree-include-file

Conversation

@matthewbauer
Copy link
Copy Markdown
Contributor

@matthewbauer matthewbauer commented Apr 1, 2026

This is a file which we use to "include" untracked files in new worktree. Disabled by default, this makes it easier to share files between main repo and worktrees. I set mine to:

.env
.envrc
**/.claude/settings.local.json

See
https://code.claude.com/docs/en/common-workflows#copy-gitignored-files-to-worktrees for how claude’s works.

Thank you for contributing to agent-shell!

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

This is a file which we use to "include" untracked files in new
worktree. Disabled by default, this makes it easier to share files
between main repo and worktrees. I set mine to:

.env
.envrc
**/.claude/settings.local.json

See
https://code.claude.com/docs/en/common-workflows#copy-gitignored-files-to-worktrees
for how claude’s works.
Comment thread agent-shell-worktree.el
(unless (string-empty-p trimmed)
trimmed))))

(defcustom agent-shell-worktree-include-filename nil
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like fairly specific behavior. How about we introduce a defcustom agent-shell-worktree-creation-functions abnormal hook, which is a little more versatile? It'll let you accomplish what you want but also enable anyone who may want a different behavior (ie. symlinks)?

@xenodium
Copy link
Copy Markdown
Owner

Thanks for the PR. Sorry for the delay. Catching up with backlog since #500.

Happy to merge in a slightly different shape. See review comment.

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

Successfully merging this pull request may close these issues.

2 participants