Readit News logoReadit News
mbakke commented on Mounting Git commits as folders with NFS   jvns.ca/blog/2023/12/04/m... · Posted by u/chmaynard
mbakke · 2 years ago
For those who resonate with "why might this be useful", here are "plain git" alternatives to this tool:

> searching for a function I deleted

    git log -G someFunc
> quickly looking at a file on another branch to copy a line from it

I use `git worktree` to "mount" long-running branches much to the same effect as Julias tool. To quickly look at a file from a non-mounted branch/commit, I use:

    git show $REF:$FILENAME
> searching every branch for a function

    git log --all -G someFunc
Note that -G can be replaced with -F for a speedup if the pattern you are searching for is a fixed string.

mbakke commented on Why only 1% of the Snowden Archive will ever be published   computerweekly.com/news/3... · Posted by u/DerekBickerton
photochemsyn · 2 years ago
Snowden made a mistake in not dumping the whole archive to Wikileaks as was done with the US State Department cables and the CIA's Vault 7 files.

I think there's probably a lot more in those files that's of great embarrassment not just to the NSA and the US government in general (such as proof that it was conducting an illegal warrantless mass surveillance program in violation of US law) - but also to their collaborators in the private tech sector who seem to have been quite active participants in the program.

For example, one of the most revealing revelations was that NSA spied on the Brazilian oil company Petrobras - which is very hard to justify on national security grounds, and instead points to industrial espionage of the kind the NSA claims it doesn't engage in (as compared to China, etc.).

https://www.reuters.com/article/us-usa-security-snowden-petr...

mbakke · 2 years ago
They were also tapping the private network links of the Norwegian oil company Equinor (formerly Statoil) according to the original leaks.

It's kind of odd that neither of these oil giants have put pressure on the U.S. government as a result. They are about the only "victims" big enough to pursue the case legally.

I suspect a Supreme Court case is just about the only thing that can bring some of the remaining documents to light. Anyone with access today is almost certainly under some gag order.

mbakke commented on Git rebase, what can go wrong   jvns.ca/blog/2023/11/06/r... · Posted by u/kens
ajkjk · 2 years ago
I love rebase (I'm a tip-of-master-only person, no merges ever, squash all your commits with `rebase -i` before pushing and write one good commit message for the group). But there's one really, really irritating thing about them:

You should not be able to use `--amend` during a rebase.

For me editing all my changes onto the commit I'm working on with `git commit -a --amend` (or as I've aliased it, `gcaa`) is automatic; I do it 500 times a day, just to save my work. But I can't count how many times I've been in the middle of squashing commits and accidentally typed `gcaa` and amended someone else's commit after fixing a merge conflict, and it's super annoying to unwind (if you realize after typing `rebase --continue`) so usually I end up just giving up and starting over. I really wish amending to a commit that wasn't one of the ones you're rebasing was just totally disabled.

I guess there are some other small complaints, like the annoying reversing of `--ours` and `--theirs` from what makes sense (yes, it makes sense if you have the internal model of rebase instead of the intuitive one, but that's stupid), rebase's tendency to pick the wrong parent commit if you've accidentally amended someone else's commit (and therefore lag a while and then produce a rebase log of 1000 commits or something), and the utter tedium of editing the rebase log to replace every instance of "pick" with "s" for squash except the first, since almost 100% of the time what I want to do is squash everything (and use the last commit message, not the first, and definitely not all of them munged together which is the default).

I would love a separate command or a flag, like "git rebase --tip" that does all of this automatically for my otherwise extremely elegant workflow (and I'm gonna be really bummed if it turns out it exists and I didn't know about it for the last 5 years...).

mbakke · 2 years ago
I have a similar workflow, but make a bunch of commits with "git commit --fixup HEAD". (Or --squash REF).

Then on the final rebase the commits are automatically ordered with s and f as appropriate.

Although I do a fair bit of amending, too.

mbakke commented on Git rebase, what can go wrong   jvns.ca/blog/2023/11/06/r... · Posted by u/kens
mbakke · 2 years ago
git rerere only "automates" conflict solving after you already solved it. As in, it remembers previous merge resolutions, even if you undo the merge/rebase.

It is particularly useful when doing difficult merges regularly. Invariably I'll find a mistake in the merge and start over (before pushing, obviously); the second "git merge" remembers the previous resolutions so I don't have to solve all the same conflicts again.

Similar for difficult rebases that may need multiple attempts.

Git remembers resolutions across branches and commits, so in the rare case where (say) a conflict was solved during a cherry-pick, rerere will automatically apply the same resolution for a merge with the same conflict.

I think the reason it's not on by default is that the UI is confusing: when rerere solves for you, git still says there is a conflict in the file and you have to "git add" them manually. There is no way of seeing the resolutions, or even the original conflicts, and no hint that rerere fixed it for you.

You just get a bunch of files with purported conflicts, yet no ==== markers. Have fun with that one if you forget that rerere was enabled.

mbakke commented on Openela releases Red Hat source code on GitHub   github.com/orgs/openela-m... · Posted by u/nolist_policy
chasil · 2 years ago
I wonder if this consortium will end up defining "enterprise" Linux in the same way that POSIX forcibly seized the standards for UNIX from the control of AT&T and Sun.

https://en.m.wikipedia.org/wiki/Unix_wars

mbakke · 2 years ago
The only "enterprise" feature of RHEL is Red Hat support.

There is nothing to standardise. If anything we need more commercially backed distributions to tear down the monoculture.

mbakke commented on Software that supports your body should always respect your freedom   fsf.org/blogs/community/s... · Posted by u/jlpcsl
mbakke · 2 years ago
Great article. Real life horror stories of life-critical software gore, with some good news at the end.

It should be illegal to sell software that someones life depends upon without giving the user the right to inspect and modify the code.

mbakke commented on Two hackers one keyboard two ways   flak.tedunangst.com/post/... · Posted by u/zdw
mbakke · 2 years ago
I used to work with a guy that mounted a keyboard vertically on each side of his chair, using both at once.

A true legend.

mbakke commented on NixOS Reproducible Builds: minimal ISO successfully independently rebuilt   discourse.nixos.org/t/nix... · Posted by u/CathalMullan
Smaug123 · 2 years ago
GCC respects SOURCE_DATE_EPOCH, and Nixpkgs has specific support for setting that environment variable: https://github.com/NixOS/nixpkgs/blob/92fdbd284c262f3e478033... (although I haven't proved that this is actually how it works for cpython's build).

Irrelevant spelunking details follow:

That string is output by cpython to contain the contents of the __DATE__ C macro (https://github.com/python/cpython/blob/fa35b9e89b2e207fc8bae... which calls to https://github.com/python/cpython/blob/fa35b9e89b2e207fc8bae... which uses the __DATE__ macro at https://github.com/python/cpython/blob/fa35b9e89b2e207fc8bae... ).

Cpython is defined in nixpkgs at https://github.com/NixOS/nixpkgs/blob/92fdbd284c262f3e478033... which I imagine (but haven't proved) uses GCC.

mbakke · 2 years ago
Thank you! Setting SOURCE_DATE_EPOCH to the most recent file timestamp found in the source input is a clever hack.
mbakke commented on NixOS Reproducible Builds: minimal ISO successfully independently rebuilt   discourse.nixos.org/t/nix... · Posted by u/CathalMullan
dataflow · 2 years ago
Doesn't caching completely defeat the point of bootstrapping? How do you know the cached artifact is correct? You have to build it manually to verify that, at which point you're still building manually...
mbakke · 2 years ago
Guix has tooling to verify binaries:

https://guix.gnu.org/en/manual/en/html_node/Invoking-guix-ch...

"guix build --no-grafts --no-substitutes --check foo" will force a local rebuild of package foo and fail if the result is not bit-identical. "guix challenge" will compare your local binaries against multiple cache servers.

I build everything locally and compare my results with the official substitute servers from time to time.

u/mbakke

KarmaCake day2255June 5, 2015
About
I am an infrastructure engineer who enjoys building high performance systems. I also spend a lot of my spare time working on GNU Guix.

https://github.com/mbakke

View Original