Earlier quoted context omitted.
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.
I found a useful Git one liner buried in leaked CIA developer docs
221–230 of 273 posts
Re: I found a useful Git one liner buried in leaked CIA developer docs
#222I 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"?
Re: I found a useful Git one liner buried in leaked CIA developer docs
#223The 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…
Re: I found a useful Git one liner buried in leaked CIA developer docs
#224If 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
Lots of people have mentioned awkward use cases where decisions have to be made. A built in command would have to confront those and it might not be easy
Re: I found a useful Git one liner buried in leaked CIA developer docs
#225Some unhinged stuff there. Like the CIA having a project called "Fine Dining" which was basically a catalog of apps that could be put on a USB drive to hide malicious code.
A case officer picks a cover app from a list of 24: VLC, Chrome, Notepad++, 2048, Breakout. Plug in the USB. Cover app opens. Exfiltration runs silently behind it. Target walks back in and the officer can just say "oh was just playing some games on this machine"
Re: I found a useful Git one liner buried in leaked CIA developer docs
#226The Git command is whatever, pretty basic and stuff i have done forever but i am glad i clicked because ended up going down the rabbithole of the Wikileaks it was sourced from Some unhinged stuff there. Like the CIA having a project called "Fine Dining" which was basically a catalog of apps that could be put on a USB drive to hide malicious code. A case officer picks a cover app from a list of 24: VLC, Chrome, Notepa…
Like unhinged was everything to do with MKULTRA which eventually became just randomly drugging people's coffee with LSD.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#227Re: I found a useful Git one liner buried in leaked CIA developer docs
#228Earlier quoted context omitted.
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 wo…
I'm personally a huge fan of the master-> main changejus5t because main is shorter to type. Might be a small win, but I checkout projects' main branches a lot.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#229Re: I found a useful Git one liner buried in leaked CIA developer docs
#230Earlier quoted context omitted.
> how do you trust the code claude wrote? If that's something you're worried about, review the code before running it. > don't you get anxiety "what if there's an error in tui code and it would mess up my git repo"? I think you might want to not run untrusted programs in an environment like that, alternatively find a way of start being able to trust the program. Either approaches work, and works best depending on wha…
> If that's something you're worried about, review the code before running it. It takes more , not less, time to thoroughly review code you didn't write.
Nope, it takes way less. Else PR reviews would take as long as coding, which they obviously don't.
Writing 1000 lines, figuring out the nuances of the domain, fixing bugs, testing, takes way more time that reading and reviewing the resulting code.
Besides, you can even ask another agent to review it. Different brand of agent even.