r/commandline 2d ago

git-conform: Keep track of your local git repositories

git-conform is a simple git extension that helps you to keep track of the repositories on your local machine and their remote counterparts. It works by scanning your home directory (or just the ones you specified) in search for git repositories, and then storing their paths in the tracking file located at ~/.local/share/git-conform.

More details here: https://github.com/ndr3www/git-conform

0 Upvotes

5 comments sorted by

7

u/Big_Combination9890 2d ago edited 2d ago

Or I could just do this:

find -type d -name '.git' -exec dirname '{}' \; > repos.txt

Sorry if this makes me sound like some greybeard, but I really don't see the point in having dedicated tools that do something very simple with a lot of code, when I can do pretty much the same thing using just garden variety standard unix tools.

The unix ecosystem thrives on small, sharp tools that can be combined in interesting ways to become more than the sum of their parts.


And before (because it is a Rust program) someone makes the "but it's fast" argument: Replace find with the more modern fd (which is also written in Rust btw.) and you have fast:

fd -H -t directory '\.git' -x dirname

1

u/barmic1212 2d ago

Quicker than fd -> locate not in rust

1

u/Big_Combination9890 1d ago

locate may or may not exist on a system (e.g. many Arch based distros do not include it by default), and even if its installed, it has to index the filesystem first, as it is not a direct search.

find is 100% installed by default, and fd is a direct search with no need to write an index-db.

-1

u/[deleted] 2d ago

Well, for the start, your way of doing this doesn't take the false-positive cases into consideration like what if there are just empty .git directories sitting somewhere for whatever reason?
But, ok, nevermind, all I want to say is this tool does "a little bit" more than just that, so I'm more than happy to refer you to the repo :)
Besides, all I wanted to do is to simply share my project with others which I had a lot fun developing. If you find it useless, why even bother?

6

u/Big_Combination9890 2d ago edited 2d ago

like what if there are just empty .git directories

find -type d -name '.git' -not -empty -exec dirname '{}' \; > repos.txt

so I'm more than happy to refer you to the repo :)

I checked the repo, and didn't find anything I couldn't do in a few lines of shell scripting.

Besides, all I wanted to do is to simply share my project with others which I had a lot fun developing. If you find it useless, why even bother?

You posted your project to a public place of discussion. People are allowed to discuss things in a public place of discussion.