Live data from Hacker News

I found a useful Git one liner buried in leaked CIA developer docs

spencer.wtf

101–110 of 273 posts

Re: I found a useful Git one liner buried in leaked CIA developer docs

#101
I use this PowerShell variant:

    function Remove-GitBranches {
        git branch --merged | Out-GridView -Title "Branches to Remove?" -OutputMode Multiple | % { git branch -d $_.Trim() }
    }
`Out-GridView` gives you a quick popup dialog with all the branch names that supports easy multi-select. That way you get a quick preview of what you are cleaning up and can skip work in progress branch names that you haven't committed anything to yet.

Re: I found a useful Git one liner buried in leaked CIA developer docs

#102
post #78

Earlier quoted context omitted.

Sorry, but this 65 yo grey-beard disagrees. A TUI to me, back in the 80s/90s, was something that ran in the terminal and was almost always ncurses-based. This was back when I was still using ADM-3A serial terminals, none of that new-fangled PCs stuff.

We might've been caught on different parts of the wave. I checked Ngrams out of curiosity https://books.google.com/ngrams/graph?content=TUI&year_start... Basically it was never used, then it was heavily used, and then never used, and then in the early 00s it took off again. That'd explain why you used it, I never did, and now young kids are.

Thanks for looking that up! It makes sense, of course - the line starts to drop in 1984, with the release of the Macintosh, and hits a trough around the launch of Windows 95.

It's not a term I recall hearing at all when I started using computers in the mid-'80s - all that mattered back then was "shiny new GUI, or the clunky old thing?" I really thought it was a retroneologism when I first heard it, maybe twenty years ago.

Re: I found a useful Git one liner buried in leaked CIA developer docs

#103

So effectively "I just discovered xargs"? Not to disparage OP but there isn't anything particularly novel here.

This feels like gatekeeping someone sharing something cool they've recently learned. I personally lean more towards the "let's share cool little productivity tips and tricks with one another" instead of the "in order to share this you have to meet [entirely arbitrary line of novelty/cleverness/originality]." But each to their own I suppose. I wonder how you learned about using xargs? Maybe a blog-post or article not…

I don't think there's anything wrong with sharing something cool, even if it's trivial to other people. The problem is framing a blog post with "ooh this was buried in the secret leaked CIA material".. and then the reader opens it to find out it's just xargs. It feels very clickbaity. Akin to "here's one simple trick to gain a treasure trove of information about all the secret processes running on your system!!" and it's just ps.

Re: I found a useful Git one liner buried in leaked CIA developer docs

#104
post #18

Earlier quoted context omitted.

The amount of little tools I'm creating for myself is incredible, 4.6 seems like it can properly one/two shot it now without my attention. Did you open source that one? I was thinking of this exact same thing but wanted to think a little about how to share deps, i.e. if I do quick worktree to try a branch I don't wanna npm i that takes forever. Also, if you share it with me, there's obviously no expectations, even it…

What's the point of open sourcing something you one shot with an LLM? At that point just open source the prompt you used to generate it.

Testing. If you share something you've tested and know works, that's way better than sharing a prompt which will generate untested code which then has to be tested. On top of that it seems wasteful to burn inference compute (and $) repeating the same thing when the previous output would be superior anyway.

That said, I do think it would be awesome if including prompts/history in the repos somehow became a thing. Not only would it help people learn and improve, but it would allow tweaking.

Re: I found a useful Git one liner buried in leaked CIA developer docs

#105

I don't delete branches, I just work with the top several most recently modified.

How to list those? Is there a flag for git branch to sort by recently modified? (not on my computer right now to check)

This isn't exactly the same but I've been using git-recent [0] (with `gr` alias) for many years. It sorts branches based on checkout order (which is what I usually need when switching between branches) and allows to easily choose a branch to checkout to.

[0] https://github.com/paulirish/git-recent

Re: I found a useful Git one liner buried in leaked CIA developer docs

#106
post #18

Earlier quoted context omitted.

The amount of little tools I'm creating for myself is incredible, 4.6 seems like it can properly one/two shot it now without my attention. Did you open source that one? I was thinking of this exact same thing but wanted to think a little about how to share deps, i.e. if I do quick worktree to try a branch I don't wanna npm i that takes forever. Also, if you share it with me, there's obviously no expectations, even it…

What's the point of open sourcing something you one shot with an LLM? At that point just open source the prompt you used to generate it.

To save time and energy?

Re: I found a useful Git one liner buried in leaked CIA developer docs

#108

    DEFAULT_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')

    git branch --merged "origin/$DEFAULT_BRANCH" \
      | grep -vE "^\s*(\*|$DEFAULT_BRANCH)" \
      | xargs -r -n 1 git branch -d
This is the version I'd want in my $EMPLOYER's codebase that has a mix of default branches

Re: I found a useful Git one liner buried in leaked CIA developer docs

#109
post #2

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.

how do you trust the code claude wrote? don't you get anxiety "what if there's an error in tui code and it would mess up my git repo"?

I assume that whatever I type can be also flawed and take precautions like backups etc

Re: I found a useful Git one liner buried in leaked CIA developer docs

#110
post #90

Anyone else "vibe git-ing” lately? I just ask Claude Opus to clean it up and it does really well. Same for build commands and test harnesses.

It does a pretty good job, but I still don't completely trust it with keys to the kingdom.

I have replaced my standard ddg of, "git " with asking Claude to give me the commands I need to run.

Post reply on HN