kowainik / hit-on

:octocat: Kowainik Git Workflow Helper Tool
https://kowainik.github.io/projects/hit-on
Mozilla Public License 2.0
76 stars 13 forks source link

[RFC] Smart interactive rebase #137

Open chshersh opened 4 years ago

chshersh commented 4 years ago

Often enough we're using the following command:

git rebase -i HEAD~3

to modify a set of commits locally. I have few ideas regarding introducing a similar command to hit:

  1. Add a command like hit edit-history 3 (probably with better name) which is equivalent to the above command.
  2. Implement smart rebase which automatically figures out how many commits to look. This probably can be done somehow by comparing master and current branch and finding common last parent. Maybe the command can be less smarter and just show be a combination of git log + git rebase...

Any thoughts? Does it make sense to introduce a command like this or it's not worth the complecity and maintenance burden?

vrom911 commented 4 years ago

Oh, I like that! Probably, just the hit edit name will be enough? Or you think that it can have some other semantic meaning?

chshersh commented 4 years ago

I like hit edit because it's short 🙂 But it could be a bit ambiguous... On the one hand, we might to add more commands to hit like hit edit issue, hit edit commit, hit edit history. On the other hand, we don't have a goal to implement a nice wrapper around git with more readable commands, the goal is to support the workflow, so adding a lot more commands we need to test might not be a good idea. However, we do use git rebase -i a lot! I just don't find rebase -i readable enough for this purposes... Alternative naming proposals:

hit rewrite
hit history
hit retro
hit time-travel