This is an obscure and confusing way of representing it. At the very least, I’d expect the addition of ⬇ to mean behind remote, and then ⬇⬆ to mean diverged (since it is logically just “both behind and ahead”).
For my part, I prefer a notation like “-4+5” to mean “4 commits behind, 5 commits ahead”, produced in this way in my $RPROMPT:
For working with many repos beyond pure status reporting there is Joey Hess's mr tool.
My only gripe is that configuration is manual and I wish there was an easy way fetch a set of repos from the well known forges into an mr config.
Oh, and I never figured out how to best work with it in a multi worktree per bare repo setup.
pabs3 5 days ago [-]
AFAIK mr does not need much config, mostly just running `mr register` after `git clone`. When you do need to set config, the `mr config` command can help. All that said, I do have a lot of custom config :)
There is a `mr bootstrap` command for pulling a repo with a .mrconfig file in it, and then pulling a bunch of repos from there, here is an example usage:
mr does have bare repo support, I haven't tried git multi-worktree stuff before though. I guess you would have to manually register each worktree.
weinzierl 5 days ago [-]
I guess what I want is a tool (not necessarily mr) that I point to a GitHub/Bitbucket/Gitlab project and it creates/updates the .mrconfig with all repos from the project.
pabs3 5 days ago [-]
I guess I would generate mr config commands using the output of gh/glab repo list and run them in shell:
You could probably do it with xargs or similar too.
pabs3 4 days ago [-]
It might be worth including such a tool into mr itself, by wrapping the official CLI tools gh/glab/etc. You could access it via `mr bootstrap github:@foo` perhaps.
stevekemp 4 days ago [-]
I wrote a wee helper to export all the repositories of your profile/organization into an MR configuration file:
But to be honest given the regular naming you might as well have a simple perl/ruby script to just read a list of names from STDIN and output the local directory-path, and remote.
It's a shell script (#!sh) and therefore easy as copy/paste to install.
adityaathalye 5 days ago [-]
Nice... I made "Bulk Git Ops" Bash functions to source into shell and tab-complete to invoke. (nb. I organise my sources like this: ~/src/{github,gitlab,bitbucket}/{usernames..}/{reponames..}).
Examples assume that repos you contribute to are spread across
remote hosts, and (hopefully) namespaced sanely. I organise my
sources as follows.
~/src/{github,gitlab,bitbucket}/{usernames..}/{reponames..}
QUERY: Count repos that are stale:
ls_git_projects ~/src/ | take_stale | count_repos_by_remote
QUERY: Count repos that are active (within 12 hours by default):
ls_git_projects ~/src/ | take_active | count_repos_by_remote
EXECUTE! Use 'xgit' to apply simple git commands to the given repos, with logs to STDERR/stty
ls_git_projects ~/src/bitbucket | xgit fetch # bitbucket-hosted repos
EXECUTE! Use 'proc_repos' to apply custom functions to, with logs to STDERR/stty
ls_git_projects ~/src/bitbucket | proc_repos git_fetch # all repos
ls_git_projects ~/src/bitbucket | take_stale | proc_repos git_fetch # only stale repos
ls_git_projects ~/src/bitbucket | take_active | proc_repos git_fetch # only active repos
EXECUTE! What's the current branch? Logs to STDERR/stty
ls_git_projects ~/src/bitbucket | proc_repos git_branch_current # all repos
EXECUTE! With logs redirected to hidden dir for logging (you must create it by hand first)
mkdir -p "${logdir}"
ls_git_projects ~/src/bitbucket | proc_repos git_branch_current 2>> "${logdir}/bulkops.log"
tail "${logdir}/bulkops.log"
gerardnico 5 days ago [-]
Nice.
I made a git exec command for that. It executes a command on multiple repos.
So to see the status of your local repositories cloned in the code directory of your home directory
A fast, cross-platform CLI tool to check the git status of multiple projects organized by categories.
Run check-projects to see which of your projects have uncommitted changes, are ahead of remote, or have other git status indicators.
r0ze-at-hn 5 days ago [-]
My own my generic and more powerful git-map lets you run any git command on all repos at the same directory level. Simply putting the shell script in your path and then $git map status or $git map fetch etc
reminds me of an project I made many years ago to manage dependencies in between repositories. So if project A was waiting for a fix in project B to be in production, you could draw a line between the two commits (from project A to project B) and get notified when the commit in project B gets into the "production" branch. And then merge and deploy your feature branch from project A.
alajmo 5 days ago [-]
Cool, I wrote a similar tool but that let's users define their own tasks (comes with a tui as well) github.com/alajmo/mani.
tomxor 5 days ago [-]
ls | xargs -I % sh -c 'cd %; pwd; git status -s'
chrisdugne 5 days ago [-]
this lists all modifications,
when check-projects tells you one line if your project is WIP:
x uralys/web
* M www
then you go work with your modifications on your project.
https://github.com/rupa/z is perfect to go from projects to projects.
tomxor 5 days ago [-]
ls | xargs -I % sh -c 'cd %; pwd; [[ $(git status -s) ]] && echo WIP || echo clean'
johnisgood 5 days ago [-]
I really like your response and your approach to it; I would like to work with you. :P
I do not need a CLI tool. I can come up with a very simple script or even an one-liner (like you just did) to achieve what I want.
Worth noting that neovim shows some git status when editing a file inside a git repository, and there are ways to do the same from your shell.
FWIW, I think this project was vibe coded with an LLM, but if it works, it works, so it makes no difference to me. The only reason I mentioned it is that "vibe coding" is not inherently bad. I do not even like the term. If you "vibe code" without knowledge, then yeah, it is bad, just as bad as a shitty developer writing code is.
tomxor 5 days ago [-]
Thanks :D I like working with people who appreciate simple solutions.
This sort of response to complex solutions used to be more prevalent on HN. When I got downvoted I was like "..this is the end isn't it" :P Maybe the unix way is a dying strategy IDK, but you give me hope.
> FWIW, I think this project was vibe coded with an LLM, but if it works, it works, so it makes no difference to me.
I did not realise that, I'd be far more worried about running it than most human coded projects out of fear of it doing something destructive. Not that humans don't make mistakes, but at least they have a mental model and intent. I suppose it depends on the definition of "vibe coded" I've heard some people talk about sending the LLM off into a loop and then trying to use the result, whereas if you are just using it as a more powerful autocomplete and playing captain then that's a lot better.
johnisgood 5 days ago [-]
Yeah, I am surprised that you would get downvoted for this. Seriously though. A simple yet effective solution. What is wrong with that?! This is what programmers used to do. :(
As for the LLM part: I have written a couple of projects with the help of LLMs and it works perfectly! I know what I wanted it to do and how, and I did extensive testing, and I am familiar with the whole code, of course. The problem arises when people who "vibe code" do not have the knowledge to begin with. It ended up writing code that I would write because of me. :D It just wrote it quicker, that is all. Ultimately I would have written the same code, but it would have taken me a bit more time because I would have had to read documentation first (which I do not mind, I love doing it).
I mean, i love those kind of cli tools but in my current mood, instead looking for it on github, I'd probably ask an frontier model:
“Create a cross-platform CLI tool that scans multiple Git projects (grouped by category) and reports their status (clean, modified, ahead, error) based on a YAML config.”
Allways surprised how far this gets me. Most of my dotfiles now got created this way.
ngalaiko 5 days ago [-]
things people do instead of having a monorepo
chrisdugne 5 days ago [-]
my projects are for different stacks, different people.
they sometimes are themselves monorepo;
the aim of check-projects is just to keep track of the work still not fully done and pushed.
fastasucan 5 days ago [-]
What if people work in different, totally unrelated projects and thus cant have the same repo?
rcleveng 5 days ago [-]
Cool, I just had claude code write me something similiar this week to go through my immediate directories and get me this type of information on each one of this (since all of my git repos are under a single dir)
chrisdugne 5 days ago [-]
fun fact: check-projects is initially a nodejs script I wrote specifically for my projects few years ago;
My first usage to test out claude code was to generalize this script: cople hours later it was entirely rewritten with Go and and CI on github actions you see now here.
Rendered at 09:46:17 GMT+0000 (Coordinated Universal Time) with Vercel.
https://github.com/alajmo/mani
> ⬆⬆ - Diverged from remote
This is an obscure and confusing way of representing it. At the very least, I’d expect the addition of ⬇ to mean behind remote, and then ⬇⬆ to mean diverged (since it is logically just “both behind and ahead”).
For my part, I prefer a notation like “-4+5” to mean “4 commits behind, 5 commits ahead”, produced in this way in my $RPROMPT:
https://myrepos.branchable.com/ https://myrepos.branchable.com/related/
My only gripe is that configuration is manual and I wish there was an easy way fetch a set of repos from the well known forges into an mr config.
Oh, and I never figured out how to best work with it in a multi worktree per bare repo setup.
There is a `mr bootstrap` command for pulling a repo with a .mrconfig file in it, and then pulling a bunch of repos from there, here is an example usage:
https://wiki.debian.org/DebianInstaller/CheckOut
mr does have bare repo support, I haven't tried git multi-worktree stuff before though. I guess you would have to manually register each worktree.
gh repo list --json url,name -q '.[] | "mr --config .mrconfig config " + .name + " " + .url' | sh
You could probably do it with xargs or similar too.
https://github.com/skx/github2mr
But to be honest given the regular naming you might as well have a simple perl/ruby script to just read a list of names from STDIN and output the local directory-path, and remote.
We've being using it for years. Very simple to setup.
It's a shell script (#!sh) and therefore easy as copy/paste to install.
ref: bulk-git-ops.sh in my repo https://github.com/adityaathalye/bash-toolkit/
This way:
I made a git exec command for that. It executes a command on multiple repos.
So to see the status of your local repositories cloned in the code directory of your home directory
´´´bash
export GIT_X_REPOS_FILE=~/code
git exec status
´´´
Code: https://github.com/gerardnico/git-x/blob/main/bin/git-exec
Doc: https://github.com/gerardnico/git-x/blob/main/docs/bin-gener...
Run check-projects to see which of your projects have uncommitted changes, are ahead of remote, or have other git status indicators.
https://github.com/r0ze-at-github/git-map
https://github.com/garden-rs/garden
[1] http://gitlab.com/garden-rs/garden
[1]: https://github.com/nosarthur/gita/
https://gerrit.googlesource.com/git-repo
x uralys/web * M www
then you go work with your modifications on your project. https://github.com/rupa/z is perfect to go from projects to projects.
I do not need a CLI tool. I can come up with a very simple script or even an one-liner (like you just did) to achieve what I want.
Worth noting that neovim shows some git status when editing a file inside a git repository, and there are ways to do the same from your shell.
FWIW, I think this project was vibe coded with an LLM, but if it works, it works, so it makes no difference to me. The only reason I mentioned it is that "vibe coding" is not inherently bad. I do not even like the term. If you "vibe code" without knowledge, then yeah, it is bad, just as bad as a shitty developer writing code is.
This sort of response to complex solutions used to be more prevalent on HN. When I got downvoted I was like "..this is the end isn't it" :P Maybe the unix way is a dying strategy IDK, but you give me hope.
> FWIW, I think this project was vibe coded with an LLM, but if it works, it works, so it makes no difference to me.
I did not realise that, I'd be far more worried about running it than most human coded projects out of fear of it doing something destructive. Not that humans don't make mistakes, but at least they have a mental model and intent. I suppose it depends on the definition of "vibe coded" I've heard some people talk about sending the LLM off into a loop and then trying to use the result, whereas if you are just using it as a more powerful autocomplete and playing captain then that's a lot better.
As for the LLM part: I have written a couple of projects with the help of LLMs and it works perfectly! I know what I wanted it to do and how, and I did extensive testing, and I am familiar with the whole code, of course. The problem arises when people who "vibe code" do not have the knowledge to begin with. It ended up writing code that I would write because of me. :D It just wrote it quicker, that is all. Ultimately I would have written the same code, but it would have taken me a bit more time because I would have had to read documentation first (which I do not mind, I love doing it).
“Create a cross-platform CLI tool that scans multiple Git projects (grouped by category) and reports their status (clean, modified, ahead, error) based on a YAML config.”
Allways surprised how far this gets me. Most of my dotfiles now got created this way.
the aim of check-projects is just to keep track of the work still not fully done and pushed.
My first usage to test out claude code was to generalize this script: cople hours later it was entirely rewritten with Go and and CI on github actions you see now here.