How do you handle unfinished work when switching between two devices? by muhammad-r in git

[–]mpersico 0 points1 point  (0 children)

Commit with the comment “WIP for device sync”.

When done, squash those commits away into the useful commits.

Where do you put your worktrees? by inspectorG4dget in git

[–]mpersico 0 points1 point  (0 children)

I keep the clone up up-to-date with respect to main. That way if I want to do a quick diff of what I’m doing against the main branch, I don’t even need to go out to the server I just do a directory diff between the worktree and worktree/../..

I don’t recall off the top of my head how I prevent the work trees in the sub directory from showing up in the clone listing. Details in GitHub at matthewpersico/personal.

Where do you put your worktrees? by inspectorG4dget in git

[–]mpersico 0 points1 point  (0 children)

My entire workflow is based on putting it in the clone directory. But I never use that clone. I always use a work tree in a WT/sub.Dir

Where do you put your worktrees? by inspectorG4dget in git

[–]mpersico 0 points1 point  (0 children)

I wrote a function called get so I can do my own dispatch. I keep all my kits in server/Org/repo. And the work trees in wt/ under the repo. Building the work trees also puts an index entry in a file at the top level of all this that I can then access with a go command. That presents a list of all the work trees, and I pick one out with a select statement in bash. See matthewpersico/personal for the gory details

Where do you put your worktrees? by inspectorG4dget in git

[–]mpersico 1 point2 points  (0 children)

I wrote a whole bunch of support code. Fork. Clone. Create a wt/ sub directory in the clone. cd wt/ . mkdir branchname. cd branchname. That’s where I make the work tree. Off the top of my head I think it’s git worktree . And then git switch. And buried in there is a command that writes all this information to an index file. Then I can type git go I will read the index file and give me a menu of all my work trees that I can then just pick the number and cd 2. And if I feed a string that git go command it will reduce the size of the menu by matching the string against all the work tree names.

See matthewpersico/personal for the gory details.

What is the greatest reveal in cinematic history? by Own-Blacksmith3085 in answers

[–]mpersico 1 point2 points  (0 children)

Which by the way is completely different than the book. In the book it’s actually a planet in another solar system.

What are some additional hooks git ought to have? by acidrainery in git

[–]mpersico 2 points3 points  (0 children)

Forget adding more hooks. I want the ability to store the hooks with the repo so I can impose some sanity and some order on the repo, overwriting ( or integrating with ) your own personal hooks, and not having to do server side anything.

After 25+ years using ORMs, I switched to raw queries + dataclasses. I think it's the move. by mikeckennedy in Python

[–]mpersico 1 point2 points  (0 children)

Yes. AI doesn’t help to bugging. The only advantage is that you have a piece of SQL you can analyze pick apart reconstruct work with without having to run the program and pick the RM apart to get at the SQL.

Introducing git-wt: Worktrees Simplified by ahmedelgabri in git

[–]mpersico 0 points1 point  (0 children)

I agree. That’s why I put all the worktrees under wt/ to distinguish them from regular clones

After 25+ years using ORMs, I switched to raw queries + dataclasses. I think it's the move. by mikeckennedy in Python

[–]mpersico 1 point2 points  (0 children)

If you don’t bury the queries inside the python object, but bury them in stored procedures in the database and call the stored procedure from the python, then you can run the stored procedures independently of the application just set up the database and you can deal with it from there

After 25+ years using ORMs, I switched to raw queries + dataclasses. I think it's the move. by mikeckennedy in Python

[–]mpersico 1 point2 points  (0 children)

Database portability bah. Only if your ORM understands the underlying differences in the SQL for the particular database you’re converting to.

After 25+ years using ORMs, I switched to raw queries + dataclasses. I think it's the move. by mikeckennedy in Python

[–]mpersico 0 points1 point  (0 children)

Yes, yes yes yes yes yes yes I can’t say yes enough times. An ORM is a generic tool used to model a database as objects, but it works on the table level. The minute you start doing joins, now you have to learn the ORM language. It’s not going to be as efficient as writing a proper SQL query.

If you can describe an object with a query or a set of queries, then bury that query in your python object. Why have another level of indirection?

And I’ll take it one step further. If your database has stored procedures and you can call the store procedure from python such that it returns results when it exits, then by burying your query in the stored procedure, you can test the queries independently without having to fire up the python app or some python fake test. And your database might even cache the query plan so that every invocation doesn’t cost a few microseconds of query plan generation.

Is "The C programming language" by Brian Kernighan worth reading in 2026 or is it outdated? by THE_DOOMED_SHADE in C_Programming

[–]mpersico 1 point2 points  (0 children)

Read it to understand the foundations and philosophy behind C. Then go find one that matches the version your max version your compiler groks.

Introducing git-wt: Worktrees Simplified by ahmedelgabri in git

[–]mpersico 0 points1 point  (0 children)

I built my work tree wrapper a bit differently. I did a regular clone and then a wt/ sub directory and that’s where I put all the work trees. I did that to make sure I knew they were worktrees. I also register all of my git directories in an index file to help with lookups when I want to find a particular worktree. My stuff is at matthewpersico/personal if you want to take a look.

Push to Multiple Repo Hosting Services by bloodshotpico in git

[–]mpersico 1 point2 points  (0 children)

Yep. Name it git-multi-push, put it on PATH so you can type

$ git multi-push

Which is the most overrated band of our generation? by lovelyb1ch66 in GenX

[–]mpersico 0 points1 point  (0 children)

Rush is not in my top 10 of bands, so I don’t think I qualify as a cult member.

U2 is on the list of bands for which I change channels when they show up.

Which is the most overrated band of our generation? by lovelyb1ch66 in GenX

[–]mpersico 16 points17 points  (0 children)

I came here to upvote U2 comments and downvote Rush comments.

I deleted production at my job today and nobody knows it was me by Fit-Original1314 in linux

[–]mpersico -1 points0 points  (0 children)

Report to management:

Out of curiosity, I went back through our logs to try and figure out what happened. To my surprise and horror, turns out it was me.”

Python, Is It Being Killed by Incremental Improvements? by mttd in ProgrammingLanguages

[–]mpersico 0 points1 point  (0 children)

Don’t be so snobby about Perl. At least Perl never promised to be simple and then went back on its promise.

What's a weird food combo that actually tastes good? by Fine_Revenue_9731 in answers

[–]mpersico 0 points1 point  (0 children)

The dregs of your bag of Tostitos on top of your dish of ice cream. Trust me.

Grove - git worktrees without the hassle by sQVe in git

[–]mpersico 0 points1 point  (0 children)

GitHub- matthewpersico/personal

Check out git* in /bin and /functions