Flockdeck docs

Using Flockdeck

Review, commit and push

Ctrl+Shift+S, or Changes in the rail, shows what changed in the working tree the focused agent has been using. Clicking the change counts in a pane's header opens it on that pane's checkout, and Review changes, in a worktree's ⋯ menu, on that worktree's, which is usually how you get here: see which agent produced something, then look at what it did.

The panel always shows the whole repository the pane is in, even when the pane was started in a folder inside it, and a commit takes every file in its list. In a project grouping more than one directory, a picker at the top chooses which repo the panel reviews. Git worktrees has the same choice for creating a worktree.

What it shows

What you can do

Everything that talks to a remote is there only when the checkout has one. The first push sets the upstream, so a branch a helper invented does not need a hand-typed command to leave the machine. A checkout with no branch checked out (a detached HEAD, or one in the middle of a rebase or a bisect) says so in place of the branch, and offers no push.

What a commit takes

A commit takes the files the list showed you when the panel opened, or when you last pressed Refresh. The list keeps up with the agents by itself, and a file that joins it after you looked, or is written to again, is marked new or edited rather than quietly added to what you commit.

If the working tree has moved since you looked (a file has appeared, one has gone back to how it was committed, or one in the list has been written to again), nothing is committed. The list then shows the tree as it is, with what moved marked; check it and commit again. Only the files that were checked are staged, so one written a moment after the check waits for the next commit.

During a merge, a file still in conflict is refused: a text file until its <<<<<<< markers are gone, and a binary file, or one that only one side kept, until you have chosen a side in a shell and added it.

What this does not promise:

Nothing here stages files selectively: a commit takes every file in the list, whole. Reviewing the diff first is the point of the panel. For anything finer, a shell pane is a keystroke away.

When git is set up to run a program

Commit, Push, Pull and Fetch run git on your machine, as you, and git runs whatever the repository tells it to: hooks in .git/hooks, a core.hooksPath, a core.sshCommand, a credential helper, a filter driver, a signing program. Many projects use hooks to lint or test before a commit, and tools such as husky set core.hooksPath for you, so Flockdeck does not turn any of it off.

An agent that can write inside .git could add a hook, though, and the next press of Commit would run it with no agent permission prompt in between. So before it runs git for you, Flockdeck reads the repository's git configuration (files it includes, a linked worktree's own configuration and each submodule's too) and the hooks git would find. If something runs that was not there when you last accepted, it stops and lists each program and the file it comes from. You can cancel, or continue and then choose between remembering it for that repository and accepting it just this time.

What you accepted is kept in Flockdeck's own state folder, not in the repository, and it only grows: what you accepted for a repository stays accepted, so linked worktrees that differ a little do not undo each other. The file is one an agent running as you could write too, so this protects you from an agent that can write inside the project and not from one that can write anywhere you can. Two Flockdeck windows of one user may overwrite each other's record at the same moment; the worst result is being asked again.

Only a folder that is not a git repository, or a machine with no git, goes ahead without the check, since git has nothing to run there. A record that cannot be read counts as no record, so the repository's own programs are asked about.

The check is not atomic. A commit is looked at when you press the button and again once your files are staged, just before git commit starts, and it is refused if what runs has changed. Staging is git add, which runs clean filters and the post-index-change hook before that second look, so those two are covered only by the first. The second look narrows the gap to the moments between it and git reading the hooks and settings; it does not close it, and a determined agent that can write inside .git can still race it. Pull, Push and Fetch are looked at once, just before. A window reached through the relay is shown the reason and told to press the button on the machine itself; approving is done there.

This covers the four buttons above. It is not every program a repository can make Flockdeck run. Still outside it:

An agent's own git commands are for auto-approve read-only and the agent's permissions. Flockdeck never runs git mergetool, so merge.tool and mergetool.* are not read, and merge.<name>.recursive only names another driver.