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.
What's missing
GitRepositoryalready hasIsDirty,IsOutOfDateandUpdateStatus()(ProjectDirector/GitRepository.cs:95-103). Three things are missing:UpdateStatus(). A grep of the app and the tests finds no caller, soIsDirtyis always false.IsOutOfDateis hard-coded tofalse. It sits next to the TODO// work out if the repository is behind the remote.ShowReposhas no status indicators. It (ProjectDirector.cs:963-986) draws only the "cloned" dot.There is also a side effect:
IsDirty,IsOutOfDateandIsClonedare 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
UpdateStatus()when theFetchRepobackground task finishes (ProjectDirector.cs:~444), and again after pull and commit operations.IsOutOfDate: inUpdateStatus(), usegit rev-list --count HEAD..@{u}, or the equivalent through the existing git wrapper. Treat "no upstream" as false.ShowRepos, alongside the cloned dot.IsDirty,IsOutOfDateandIsCloned[JsonIgnore].Acceptance criteria
IsDirty,IsOutOfDateorIsCloned.