Live data from Hacker News

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

spencer.wtf

191–200 of 273 posts

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

#193

Here's my take on the one-liner that I use via a `git tidy` alias[1]. A few points: * It ensures the default branch is not deleted (main, master) * It does not touch the current branch * It does not touch the branch in a different worktree[2] * It also works with non-merge repos by deleting the local branches that are gone on the remote git branch --merged "$(git config init.defaultBranch)" \ | grep -Fv "$(git config…

This is a good one you should contribute it to git extras.

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

#196

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

Seriously, this seems like someone in awe of xargs. Maybe its the Bell Labs in me but this is boilerplate stuff.

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

#197

Here's my take on the one-liner that I use via a `git tidy` alias[1]. A few points: * It ensures the default branch is not deleted (main, master) * It does not touch the current branch * It does not touch the branch in a different worktree[2] * It also works with non-merge repos by deleting the local branches that are gone on the remote git branch --merged "$(git config init.defaultBranch)" \ | grep -Fv "$(git config…

The use of init.defaultBranch here is really problematic, because different repositories may use a different name for their default, and this is a global (your home directory scope) setting you have to pre-set. I have an alias I use called git default which works like this: default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' then it becomes ..."$(git default)"... This figures out th…

I have a global setting for that. Whenever I work in a repo that deviates from that I override it locally. I have a few other aliases that rely on the default branch, such as “switch to the default branch”. So I usually notice it quite quickly when the value is off in a particular repo.

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

#198

Here's my take on the one-liner that I use via a `git tidy` alias[1]. A few points: * It ensures the default branch is not deleted (main, master) * It does not touch the current branch * It does not touch the branch in a different worktree[2] * It also works with non-merge repos by deleting the local branches that are gone on the remote git branch --merged "$(git config init.defaultBranch)" \ | grep -Fv "$(git config…

The use of init.defaultBranch here is really problematic, because different repositories may use a different name for their default, and this is a global (your home directory scope) setting you have to pre-set. I have an alias I use called git default which works like this: default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' then it becomes ..."$(git default)"... This figures out th…

This is a great solution to a stupid problem.

I work at a company that was born and grew during the master->main transition. As a result, we have a 50/50 split of main and master.

No matter what you think about the reason for the transition, any reasonable person must admit that this was a stupid, user hostile, and needlessly complexifying change.

I am a trainer at my company. I literally teach git. And: I have no words.

Every time I decide to NOT explain to a new engineer why it's that way and say, "just learn that some are master, newer ones are main, there's no way to be sure" a little piece of me dies inside.

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

#199

Earlier quoted context omitted.

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 felt almost like satire to me, especially with the name "ciaclean".

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

#200

If something this natural requires several lines of bash, something is just not right. Maybe branches should go sorted by default, either chronologically or topologically? git's LoC budget is 20x LevelDBs or 30% of PostgreSQL or 3 SQLites. It must be able to do these things out of the box, isn't it? https://replicated.wiki/blog/partII.html

"too many lines of bash" and "lines of code" seem like very strange metrics to use to form these types of opinions.
Post reply on HN