4 ms·
I like the attempt; git cli has a steep initial learning curve and thinking about the git interface and seeing if we can name & simplify it is worthwhile. > Re
by dahart 4y ago
I like the attempt; git cli has a steep initial learning curve and thinking about the git interface and seeing if we can name & simplify it is worthwhile.
> Revert it without modifying history
Git revert modifying history is a feature!! It’s a safety net that allows you to, for example, revert the revert if the first revert was a mistake. Sometimes you don’t know the first revert is a mistake until later...
Likewise the undo command loses working tree progress just like git reset --hard, but I’m wondering is this the default behavior you want in an “easy” git wrapper?
What if a git wrapper designed to be easy also thought hard about how to make every single command safer than it is by default with git, for example, quietly making a backup of any work you want to undo or revert? Like maybe you could make branches with a special naming scheme so they’re normally hidden by the wrapper, and cleaned up later, but identifiable so you can bring them back. Or maybe the cli wrapper could provide a more intuitive & useable interface for the reflog.
One thing that would be useful with a git wrapper is a version of git stash that uses branches instead of the stash. This is because the stash is not in the reflog, and it doesn’t have the same level of safety that commits & branches do (the git stash manual mentions this). The biggest unintentional losses of code I’ve seen are git stash accidents, not counting people getting frustrated not knowing how to use git to fix a mess, and nuking their repo.
- hn_20591249 4y agoAgreed, don't want to discourage this project as it is helpful to have more tools to learn the rather deep and complex Git interface, but changing Git functionality under the hood is a big no-no in my mind. Using this tool on an existing Git repository and rewriting history could get the book thrown at you by more senior engineers.
- mynameisvlad 4y ago> get the book thrown at you by more senior engineers. We're all professionals working in a professional environment. "Git jail" isn't a thing. The "Git courts" won't take away your ability to use Git. If anything, this would be an opportunity for a senior engineer, you know the people that are supposed to mentor and role model juniors, to give guidance on how to revert in the future.
- renewiltord 4y agoI rewrite history all the time. And this is just porcelain. No one will be able to tell whether you rebase/reset/amend or use it. I've got more than a decade working with the tool and use rebase daily. Hasn't been a problem yet.
- kerblang 4y agoThe original claim makes no sense to me, nor does your complaint; `git revert` specifically creates new history rather than trying to do something rebase-like and change history/force push. That's why it's easy to revert the revert. Yes, I highly recommend git revert. So if the author really means "git revert with a nicer user interface" then by all means have at it, although I don't see what anybody is disagreeing on.