Skip to content

not showing worktrees in a clean way #46

@matthewsht

Description

@matthewsht

git-statuses 0.6.2

I'm starting to use/play with git worktrees (https://git-scm.com/docs/git-worktree) and wonder if git-statuses can display related worktrees a little cleaner.

In the output below are two examples.
The "packer" directory has two directories, one is "main" and is the main/primary/whatever repo and "fix-runtime-tags" is the worktree off of it.
That worktree is in the directory "cloud/ssa-packer/fix-runtime-tags"

Similarly the "ssa-terraform" directory contains "main" -- the main repo dir and "cloud/ssa-terraform/rocky-10-update" is the worktree off of it.

For myself I'd be happy with a directory like location and just some obvious indication that this is a worktree. Perhaps a more verbose output could indicate which parent the child worktree points to.

❯ git-statuses -d 3 ~/code
┌───────────────────────────────────────────────────────┬────────────────────────┬───────┬─────────┬────────────────┐
│ Directory                                             ┆ Branch                 ┆ Local ┆ Commits ┆ Status         │
╞═══════════════════════════════════════════════════════╪════════════════════════╪═══════╪═════════╪════════════════╡
│ cloud/ssa-packer/main                                 ┆ main                   ┆ ↑0 ↓0 ┆ 140     ┆ Dirty (1)      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ cloud/ssa-packer/main/.git/worktrees/fix-runtime-tags ┆ fix-runtime-tags       ┆ ↑0 ↓0 ┆ 146     ┆ Clean          │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ cloud/ssa-terraform/main                              ┆ main                   ┆ ↑0 ↓1 ┆ 216     ┆ Clean          │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ cloud/ssa-terraform/main/.git/worktrees/rocky-10-upda ┆ rocky-10-update        ┆ ↑0 ↓0 ┆ 222     ┆ Clean          │
│ te                                                    ┆                        ┆       ┆         ┆                │
<rest of output elided>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions