I wrote Emacs Script to Review Git Status of Repositories for creating a checklist of repositories to review. Over on /r/emacs, someone provided the following:
Similar to that, one can define
magit-repository-directorieswhich is a list of folders for magit to look for git projects - including an optional integer per each representing how deep to search. After you do that you can get a status overview using
magit-list-repositorieswhich shows projects name, version, status (untracked, unstaged, staged) and numbers of unpushed/unpulled commits from upstream. Very convenient. Also
C-u magit-statuslets you jump to one of these repositories using auto-complete.
Curious, I spent a bit of time exploring the Magit 🔍 function route, and settled on the following configuration:
(setq magit-repolist-columns '(("Name" 25 magit-repolist-column-ident ()) ("Version" 25 magit-repolist-column-version ()) ("D" 1 magit-repolist-column-dirty ()) ("⇣" 3 magit-repolist-column-unpulled-from-upstream ((:right-align t) (:help-echo "Upstream changes not in branch"))) ("⇡" 3 magit-repolist-column-unpushed-to-upstream ((:right-align t) (:help-echo "Local changes not in upstream"))) ("Path" 99 magit-repolist-column-path ()))) (setq magit-repository-directories `( ("~/git/takeonrules.github.io/themes/hugo-tufte" . 1) ("~/git/takeonrules.github.io/" . 1) ("~/git/dotzshrc/" . 1) ("~/git/ndlib/sipity" . 1) ("~/git/samvera/hyrax" . 1)))
Now when I run
M-x magit-list-repositories I get the equivalent buffer:
If there’s a non-blank in
D column then there’s changes to commit. The
⇣ column shows me what’s upstream that I don’t have locally. And the
⇡ column shows me what I have locally that I haven’t pushed upstream.
And from the above buffer, I can quickly open a
magit-status buffer to begin commiting changes and synchronizing repositories.
So with that, I can get an overview of all of the relevant repositories and take action accordingly. This supplants