Live data from Hacker News

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

spencer.wtf

161–170 of 273 posts

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

#161

Earlier quoted context omitted.

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"?

Isn't it this case no matter who wrote the code? How do you ever run anything if you're worried about bugs?

It makes a difference whether an AI or a human wrote it. AIs make more random, inconsistent errors or omissions that a human wouldn’t make. AIs also don’t dog-feed their code the way human developers of tools usually do, catching more errors or unfit/missing logic that way.

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

#162

I use `master` in all my repos because I've been using it since forever and it never has once occurred to me "oh shit I better change it to `main` this time in case `master` may offend somebody some day. Unfortunately, that's the last thing on my mind when I'm in programming mode. Now that everything is `master`, maybe it is just a simple git command to change it to `main`. But, my fear is it'll subtly break somethin…

> But, my fear is it'll subtly break something and I just don't have enough hours left in my life to accept yet unknown risk that it'll cost me even more hours,

Yeah, it's not like 99% of the world has already switched from master to main already (without any major problems) ...

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

#163
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.

Can you explain TUI? I have never heard this before

https://en.wikipedia.org/wiki/Text-based_user_interface

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

#164
I keep a command `git-remove-merged`, which uses `git ls-remote` to see if the branch is set up to track a remote branch, and if it is then whether the remote branch still exists. On the assumption that branches which have had remote tracking but no longer do are either merged or defunct.

https://gist.github.com/andrewaylett/27c6a33bd2fc8c99eada605...

But actually nowadays I use JJ and don't worry about named branches :).

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

#165

Earlier quoted context omitted.

At Meta, when this mass push for the rename happened across the industry, a few people spent nearly the full year just shepherding the renaming of master to main, and white box/black box to allowlist/blocklist. This let them claim huge diff counts and major contributions to DEI and get promos.

Same at my org at the time, blacklist was nixed, no matter how many times the question, "What color is ink on a page?" was brought up.

The colour of the ink is not where "blacklist" comes from though? It's not from supposed skin colour either...

Blocklist makes more sense in most scenarios.

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

#166

I use `master` in all my repos because I've been using it since forever and it never has once occurred to me "oh shit I better change it to `main` this time in case `master` may offend somebody some day. Unfortunately, that's the last thing on my mind when I'm in programming mode. Now that everything is `master`, maybe it is just a simple git command to change it to `main`. But, my fear is it'll subtly break somethin…

Thank you for creating the containment thread.

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

#167

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…

[deleted]

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

#168

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

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)

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

#169

I use `master` in all my repos because I've been using it since forever and it never has once occurred to me "oh shit I better change it to `main` this time in case `master` may offend somebody some day. Unfortunately, that's the last thing on my mind when I'm in programming mode. Now that everything is `master`, maybe it is just a simple git command to change it to `main`. But, my fear is it'll subtly break somethin…

[flagged]

The whole master/main thing is a dinstinctly American culture war issue which, unfortunately, infected the rest of the world.

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

#170
I work with GitHub, so this oneliner relly helps me out. It also doesn't rely on grep, since --format have all you need:

    git branch --format '%(if:equals=gone)%(upstream:track,nobracket)%(then)%(refname:short)%(end)' --omit-empty | xargs --verbose -r git branch -D
It deletes all the branches for which remotes were deleted. GitHub deletes branches after PR was merged. I alias it to delete-merged
Post reply on HN