Skip to content

Repo list never shows which clones are dirty or behind their remote (GitRepository.UpdateStatus is never called) #479

Description

@matt-edmondson

What's missing

GitRepository already has IsDirty, IsOutOfDate and UpdateStatus() (ProjectDirector/GitRepository.cs:95-103). Three things are missing:

  • Nothing calls UpdateStatus(). A grep of the app and the tests finds no caller, so IsDirty is always false.
  • IsOutOfDate is hard-coded to false. It sits next to the TODO // work out if the repository is behind the remote.
  • ShowRepos has no status indicators. It (ProjectDirector.cs:963-986) draws only the "cloned" dot.

There is also a side effect: IsDirty, IsOutOfDate and IsCloned are public getters with no [JsonIgnore]. They are written into the options JSON on every save, even though they are runtime state.

Why it matters

The app fetches every repository in the background every 60 seconds and offers "Pull All". Even so, it never tells the user which repositories have incoming commits or uncommitted work. Today the only way to find out is to select each repository in turn, or to wait for a pull prompt.

Suggested implementation

  • When to refresh: call UpdateStatus() when the FetchRepo background task finishes (ProjectDirector.cs:~444), and again after pull and commit operations.
  • Computing IsOutOfDate: in UpdateStatus(), use git rev-list --count HEAD..@{u}, or the equivalent through the existing git wrapper. Treat "no upstream" as false.
  • Display: draw a "dirty" indicator and a "behind" indicator next to each repository in ShowRepos, alongside the cloned dot.
  • Persistence: mark IsDirty, IsOutOfDate and IsCloned [JsonIgnore].

Acceptance criteria

  • After a background fetch brings in new upstream commits, that repository shows as behind in the list.
  • A working tree with uncommitted edits shows as dirty.
  • A repository with no upstream branch is never shown as behind.
  • The saved options file no longer contains IsDirty, IsOutOfDate or IsCloned.

Activity

  1. matt-edmondson commented on Oct 6, 2026

    @matt-edmondson
    ContributorAuthor

    Triage

    • Category: Feature Request. It also carries a small bug: runtime-only state (IsDirty, IsOutOfDate, IsCloned) is persisted into the options JSON.
    • Priority: Medium. Nothing breaks, but the repository list can't answer the main question the 60-second background fetch exists to answer.
    • Area / suggested assignment: Git status model and repo-list UI (GitRepository.cs UpdateStatus / IsOutOfDate, ShowRepos, and the FetchRepo completion).
    • Duplicates / related: No duplicate found.
    • In progress: No open PR covers it. Open PR Refresh after a clone on the render thread, and allow one clone per folder [patch] #474 changes RefreshPage threading after a clone. Coordinate so that UpdateStatus() after fetch, pull, and commit also runs off the render thread or is marshalled back safely.
    • Notes: The [JsonIgnore] part is trivial and could land on its own first. For IsOutOfDate, use rev-list --count HEAD..@{u} and treat "no upstream" as not behind.

    Generated by Claude Code

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