I currently have a TUI addiction. Each time I want something to be easier, I open claude-code and ask for a TUI. Now I have a git worktree manager where I can add/rebase/delete. As TUI library I use Textual which claude handles quite well, especially as it can test-run quite some Python code.
> Each time I want something to be easier, I open claude-code and ask for a TUI.
WTF has happened to software development, that anyone thinks they need "AI" for that? Any self-respecting half-way decent IDE has had parameterized templates for that since at least the mid-1990s. (They used to be called "Wizards" on Windows, or "Experts" in the Borland tools.)
Select "File", "New", "[Whatever]", answer a few questions in a (series of) dialog(s), click "Finish", and hey presto!, you had a new project, templated according to your preferences, with the UI scaffolding all finished. (Mostly GUI, of course, since that was the hot new thing back then; but could just as easily have been TUI, and I suppose some had that too.)
All done locally on your stonking new 486 266 Mhz / 16 MB. No need to burn half the planet to run some LLM "in the cloud", i.e. on someone else's machine in a datacenter somewhere. Jeebus fuck, does one have to be labelled "old curmudgeon" just for thinking there's something seriously wrong going on here nowadays?
Lots of negative sentiment on your comment, but I was going to write the same. Hopefully AI won’t make us forget that good command line tools are designed to be chained together if you want to achieve something that’s perhaps too niche as a use case to make it into a native command. It’s worth learning about swiss army utilities like xargs that make this easy (and fun)
What nauseous sentiment. I recommend "The CIA as Organized Crime: How Illegal Operations Corrupt America and the World" by Douglas Valentine, ISBN 978-0997287011. One of the most evil organizations ever to have existed.
Speaking of user friendliness of git UI. I am working on a revision control system that (ideally) should be as user friendly as Ctrl+S Ctrl+Z in most common cases. Spent almost a week on design docs, looking for feedback (so far it was very valuable, btw)
I've had essentially that - if a bit fancier to accept an optional argument as well as handle common "mainline" branch names - aliased as `git lint` for a while:
The main issue with `git branch --merged` is that if the repo enforces squash merges, it obviously won't work, because SHA of squash-merged commit in main != SHA of the original branch HEAD.
What tools are the best to do the equivalent but for squash-merged branches detections?
Note: this problem is harder than it seems to do safely, because e.g. I can have a branch `foo` locally that was squash-merged on remote, but before it happened, I might have added a few more commits locally and forgot to push. So naively deleting `foo` locally may make me lose data.
3. grep upstream git log for a commit with the same commit subject
Has some caveats, like
if upstream's commit was amended or the actual code change is different, it can have a false positive, or
if there are multiple commits on your local branch, only the top commit is checked
I recently revised my script to rely on (1) no commits in the last 30 days and (2) branch not found on origin. This is obviously not perfect, but it's good enough for me and just in case, my script prompts to confirm before deleting each branch, although most of the time I just blindly hit yes.
I also set mine up to run on `git checkout master` so that I don't really have to think about it too hard -- it just runs automagically. `gcm` has now become muscle memory for me.
IIRC, you can do git branch -D $(git branch) and git will refuse to delete your current branch. Kind of the lazy way. I never work off of master/main, and usually when I need to look at them I checkout the remote branches instead.
99 comments
[ 5.0 ms ] story [ 79.5 ms ] threadWTF has happened to software development, that anyone thinks they need "AI" for that? Any self-respecting half-way decent IDE has had parameterized templates for that since at least the mid-1990s. (They used to be called "Wizards" on Windows, or "Experts" in the Borland tools.)
Select "File", "New", "[Whatever]", answer a few questions in a (series of) dialog(s), click "Finish", and hey presto!, you had a new project, templated according to your preferences, with the UI scaffolding all finished. (Mostly GUI, of course, since that was the hot new thing back then; but could just as easily have been TUI, and I suppose some had that too.)
All done locally on your stonking new 486 266 Mhz / 16 MB. No need to burn half the planet to run some LLM "in the cloud", i.e. on someone else's machine in a datacenter somewhere. Jeebus fuck, does one have to be labelled "old curmudgeon" just for thinking there's something seriously wrong going on here nowadays?
It also has one for squash-merged branches: gbds
Very useful I've been using them for years
What nauseous sentiment. I recommend "The CIA as Organized Crime: How Illegal Operations Corrupt America and the World" by Douglas Valentine, ISBN 978-0997287011. One of the most evil organizations ever to have existed.
2. Enumerate local branches, selecting each that has been marked as no longer having a remote version (ignoring the current branch)
3. Delete the local branch safely
https://replicated.wiki/blog/partII.html#navigating-the-hist...
What tools are the best to do the equivalent but for squash-merged branches detections?
Note: this problem is harder than it seems to do safely, because e.g. I can have a branch `foo` locally that was squash-merged on remote, but before it happened, I might have added a few more commits locally and forgot to push. So naively deleting `foo` locally may make me lose data.
It prints the results of 3 methods:
1. git branch --merged
2. git cherry
3. grep upstream git log for a commit with the same commit subject
Has some caveats, like if upstream's commit was amended or the actual code change is different, it can have a false positive, or if there are multiple commits on your local branch, only the top commit is checked
Pipe right to deletion if brave, or to a choice-thingy if prudent :)
To avoid losing any work, I have a habit of never keeping branches local-only for long. Additionally this relies on https://docs.github.com/en/repositories/configuring-branches...
I assume CIA stands for Clean It All.
I also set mine up to run on `git checkout master` so that I don't really have to think about it too hard -- it just runs automagically. `gcm` has now become muscle memory for me.