4 ms·
I feel like I have a pretty good understanding of git, but the problems these helpers are trying to solve make my head spin. > git rebase --interactive can onl
by doix 4y ago
I feel like I have a pretty good understanding of git, but the problems these helpers are trying to solve make my head spin.
> git rebase --interactive can only repair linear series of commits, not trees. If you modify a commit with multiple children, then you have to be sure to rebase all of the other children commits appropriately.
Can someone explain (preferably with a sequence of git commands) how you end up in such a situation? When would you end up modifying a commit with multiple children?
Is this for a case where a bunch of people branch from master@HEAD (lets call this A), then you need to modify A, so you then need to rebase each branch that branched from A individually?
I guess the workflows I'm used too explicitly try to avoid doing things that cause the problems that these helpers try to solve. I'm so used to thinking in this current mode that I find it hard to imagine when these problems would arise.
'git undo' terrifies me though. I really hate when there's lots of magic going on and I don't know what state my git repo will end up when I run a command. I rather run N commands, where I'm pretty confident what will happen in each stage, than one command that just 'fixes' things. Because if it fails to fix something, I'll be in some unknown state without understanding how I got into it.
- arxanas 4y ago> Is this for a case where a bunch of people branch from master@HEAD (lets call this A), then you need to modify A, so you then need to rebase each branch that branched from A individually? Mainly it's for when you branch from A multiple times, and then modify A. This can happen if you have some base work that you build multiple features on top of. I routinely do this as part of rapid prototyping, as described here: https://github.com/arxanas/git-branchless/wiki/Workflow:-divergent-development https://github.com/arxanas/git-branchless/wiki/Workflow:-div... `git undo` shows a list of operations it'll execute, which you have to confirm before accepting. Of course, it's ultimately a matter of trust in the tools you use.
- doix 4y agoAh, I should have looked through the wiki. That is cool, I do something similar with a scuffed workflow with lots of cherry-picking. My approach does look significantly worse than this helper though. > `git undo` shows a list of operations it'll execute, which you have to confirm before accepting. Of course, it's ultimately a matter of trust in the tools you use. Nice! I guess it's time to setup rust and check this out. Are you the author? I hope my comments did not come across as too negative. It's more a matter of me living in a git bubble and failing to appreciate the tool.
- arxanas 4y agoYes, I am the author. > I hope my comments did not come across as too negative. Not at all! > guess it's time to setup rust and check this out It's also available on many package managers, such as Homebrew and Nix, although you'd have to build from source for the latest development version.