Comment by gcarvalho

13 hours ago

I have a very involved `gq` alias that helps me find and finish pending work. It works either in the current repository or a folder containing multiple repositories.

Basically, my assumption is that `gq` should return empty, which means I have a clean slate, and can start taking on new work. Otherwise, there is ongoing work that needs attention.

It just lists:

  * modified/untracked files
  * stashed changes
  * local-only branches (not tracking a remote branch)
  * branches out-of-sync with their upstream (either ahead or behind)
  * branches that aren't the main branch (even if tracking and in-sync with a remote upstream)

Getting this command to return empty is a surprisingly effective way to stay productive, especially when losing focus due to too much work.

It's basically inbox-zero for git.

But it only works if you like working with a clean worktree.