Live data from Hacker News

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

spencer.wtf

181–190 of 273 posts

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

#181
post #159

Earlier quoted context omitted.

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.

> What color is ink on a page? Middle gray, according to modern UX designers. ;)

You are lucky. It's often light gray on thin fonts.

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

#182

Earlier quoted context omitted.

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.

Seems like a bad faith question, unfortunate that it was asked multiple times. Blacklist is derived from a definition where black means "evil, bad, or undesirable". When you say that ink is black, you're using a different definition, which relates to color. I don't know if I see the objection to blackbox, which uses a definition of "unknown". Personally, I think the harm is small but I look to people of color for gui…

The irony is that the term "Black" was precisely chosen by Black civil rights activists in the 1960s. This wasn't a term given by white people, it was specifically chosen by Blacks, because of its negative connotations. They wanted to embrace its negative connotations and turn it on its head, and that's where terms like "Black is beautiful" came from. They didn't want to be ashamed of it, that's why they embraced it. Black was not a term of shame, it was a term of power.

Now, the left wing activists have turned it on its head again, and now saying that the term "black" is shameful and racist. It's bizarre how ignorant people are who say the term "blacklist" is racist.

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

#183
post #158

Earlier quoted context omitted.

Also, git's "master" branch is named after a master recording or master copy, the canonical original from which duplicates are made. There is literally no reason for it be offensive except for those who retroactively associate the word with slavery.

Nope, the term comes from bitkeeper which does refer to master/slave. See this email for some references: https://mail.gnome.org/archives/desktop-devel-list/2019-May/...

Does git use "slave?"

Then does simply performing a search on bitkeepers documents for "slave" then automatically imply any particular terminology "came from bitkeeper?"

Did they take it from bitkeeper because they prefer antiquated chattel slavery terminology? Is there any actual documents that show this /intention/?

Or did they take it because "master" without slave is easily recognizable as described above which accurately describes how it's _actually_ implemented in git.

Further git is distributed. Bitkeeper was not.

This is just time wasting silliness.

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

#184

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…

Haven't got enough hours to type fewer characters, but have got plenty of time to go karma-fishing about it on an almost barely tangentially relevant HN thread. Cool.

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

#185
post #30

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…

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.

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

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

#187

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 the actual default from the origin.

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

#190
post #128

Earlier quoted context omitted.

I push my branches daily, so I wouldn't lose that much work. If it breaks then I ask it to fix it. But I do quickly check the output what it does, and especially the commands it runs. Sometimes it throws all code in a single file, so I ask for 'good architecture with abstractions'.

I see this regularly: "I use GitHub to backup my local repos." If `gh repo ...` commands get run you can lose everything instantly. You can force push and be left with a single blank commit on both sides. The agent has full control of everything, not just your local data. Just set up Rclone/restic and get your stuff into a system with some immutability.

Force pushing doesn't actually remove anything from the remote repository, only changes some references for which commits the branches point to. Plus, any forks on github will be completely unaffected. It's not perfect, since Github doesn't seem to offer any history of such reference alterations (a la the reflog), but it's still a valuable offsite backup from a developer's perspective.
Post reply on HN