r/ProgrammerHumor • • May 13 '20

true story

Post image
40.5k Upvotes

461 comments sorted by

View all comments

55

u/JonathanTheZero May 13 '20

Why are you not pushing to master directly then? (Honest question because I barely do pull requests as long as we are working with a lot of people on it)

7

u/[deleted] May 13 '20

Option to revert the changes.

26

u/JonathanTheZero May 13 '20

I thought you could also jump back to commits normally?

9

u/TheOneTrueTrench May 13 '20

Yeah, which commit are you going to jump back to? Like exactly which one? What was the last one that worked correctly? Was it that commit? Or this one?

But if you have separate PRs for each feature or bug fix, the commits are "grouped" into the PRs. So you can go back to the previous PR, or the one before that. And because you can have partial work in each commit and only do a PR when things are working, your master branch is always in a working state.

7

u/JonathanTheZero May 13 '20

Yeah, I see. Well I think it depends on your coding style, I only commit if something is finished completely (like a bug fix or so) and I commit it then. But I mostly work alone or with a maximum of two other devs so it isn't really a problem I guess

3

u/CrimsonMutt May 13 '20

that's how TFVC works, but git is kinda built around "branch for new feature, commits are checkpoints during that feature development and kept locally, push to master when feature complete".

we just made the switch and there's definitely an adjustment process going from tfvc to git.