4 ms·
This is interesting. At work we use PRs like the author uses commits, and in fact we squash-and-merge them at the end, but our approach requires rebasing the la
by strken 2y ago
This is interesting. At work we use PRs like the author uses commits, and in fact we squash-and-merge them at the end, but our approach requires rebasing the later PRs whenever we make a change to the earlier PRs. This can be quite laborious, falls afoul of the "don't force-push" rule, takes a long time for engineers to learn, and tends to break existing code review comments in the GitHub interface, but works out okay for two or three PRs. In our workflow a commit is less a unit of work and more a savepoint.
I also use heavily use stashes, as well as undo-tree-mode in Emacs. This means we have four different ways of tracking the history of source code, which sounds redundant but works out okay in practice.
The ergonomics of doing this in Git are pretty bad. I found Phabicator better but still unnecessarily difficult. Perhaps a new source control management tool could have first class support for higher level concepts than just commits and branches, or perhaps that would be even worse to use.
- steveklabnik 2y ago> Perhaps a new source control management tool could have first class support for higher level concepts than just commits and branches, or perhaps that would be even worse to use. You should check out jj, sapling, or mercurial.
- eddd-ddde 2y ago+1 for jj It simplifies my workflow a lot when compared to plain git. I love not having to track and stage manually, plus undo is godsend.
- rfoo 2y agoIf you are stuck with git, try git-branchless. At least it makes rebasing your patch stack easier (git sync && git submit).
- keybored 2y agoGit-branchless gave me thousands of refs that a simple deinit wouldn’t delete. It’s so heavyweight for just experimenting with a few new workflows here and there. I can’t recommend Git-branchless until it either tells me what it is about overall or figures it out for itself.
- steveklabnik 2y agojj (and sapling, in my understanding) uses git as a backend, so you can use it even if you're stuck with git. Not that I think git-branchless is bad, mind you, but just to be clear about it.
- keybored 2y agoYou use commits as PRs. This complicates things because of PR dependencies. Why not a better tool than Git? Sure, I would like a more user-friendly tool as well. Less warts. But what about the stopgap solution of simply treating commits like commits instead of making things harder for yourself? (I wonder how much GitHub is to blame for giving people these PR-colored glasses)
- steveklabnik 2y agoGiven that you can use git with Gerrit, I am confident in placing the blame on GitHub here.