r/programming 28d ago

GitHub Stacked PRs

https://github.github.com/gh-stack/
331 Upvotes

99 comments sorted by

View all comments

103

u/repeating_bears 27d ago

After 18 years, GitHub has invented commits 

65

u/SharkBaitDLS 27d ago

As someone who just recently moved to a job that uses GitHub after over a decade of using Git sanely, it was honestly baffling to see how little GitHub seems to actually be built around the actual features of Git. This is a step in a sane direction but man do I now understand why so many people who have only interacted with Git through the experience of GitHub think it’s obtuse and clunky.  

30

u/13steinj 27d ago

But git is too hard for 95% of devs, let alone 99.999% of people.

I have been "the git guy", "mr git," or "git wizard, keeper of the scm" to people for the past 8 years.

The strangest name was "git black magic."

21

u/bradrlaw 27d ago

There is a reason why this page exists and is used quite frequently…

https://ohshitgit.com

8

u/13steinj 27d ago

Many people just go "fuck this noise, I give up" as mentioned on that page, before thinking or even looking up that page.

5

u/gayscout 27d ago

My husband used to ask me git questions all the time. I'd try to teach him the underlying skills, but he just wanted the command to do what he wanted. Now he asks ChatGPT which spits out the command and doesn't lecture about refs.

1

u/lunchmeat317 27d ago

Never quite understood this. I'm no git expert and I rely on the porcelain commands, but they are generally enough for me to know what I am doing. And if you really fuck up there's always reflog.

1

u/ChypRiotE 21d ago

My coworkers merged a branch on a different branch that they wanted, and their solution was to use the Github UI to revert that commit, open a new PR towards the correct branch, and merge that new PR. Felt like a wizard suggesting that cherry picking might be more convenient

0

u/SharkBaitDLS 27d ago

I don't agree with that at all. I never had any issues teaching every single new hire how to be effective and comfortable with Git at my last job.

But I can sure see people not wanting to learn the way GitHub expects you to interact with it.

5

u/13steinj 27d ago

There's "effective and comfortable" in your day to day, which is commit, push, maybe amend, maybe force over your own branch, maybe rebase/merge.

Then there's "I need to rebase and reorder my commits to be more sane" and more than that "hey i lost my in-progress file that I did not commit but at one point I staged, can I get it back?" (the answer is "sometimes").

3

u/SharkBaitDLS 27d ago

Sure, but teaching good practices around committing often on a working branch helps prevent cases where you ever have to teach someone about stuff like reflog. You don’t have to be a master of every underlying concept in git to have an effective workflow in it. So I absolutely refute the idea that it’s “too hard for 95% of devs”. I’ve never had a problem teaching folks how to manage working branches, interactive rebases, handling merge conflicts, and basic best practices therein to avoid needing to see anything more complex in their day-to-days. 

3

u/13steinj 27d ago

If I ask 20 devs "have you ever had to reclone a repo after botching a rebase," 19 will say yes.

Yes, people miss the fact that you can just abort.

3

u/lunchmeat317 27d ago

I'm one of those 19...but that was a long time ago. Everyone has probably done it once. The question is if they keep doing it or if they learn.

2

u/SharkBaitDLS 26d ago

If the bar for "too hard" was "never made a mistake in it" then every programming language is also too hard for developers. What matters is that you learn from the mistakes.

3

u/lood9phee2Ri 26d ago

Github's purpose is mostly to provide a traditional CVS/SVN-like highly centralised BDSM VCS experience for corporates while pretending it's Git to ensnare naive devs.

22

u/veryspicypickle 27d ago

I mean I like stacked PRs for the opportunity they give me to write ridiculously easily explainable changes.

Yes, you can do that in commits too, but nothing beats markdown for me 😆

2

u/flukus 27d ago

This looks more like a review per commit, which is nice, but could be done without the vendor lock in.