Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What I mean is that I do not want a single "swiss army knife" rebase command that does everything with lots of options to remember. It's fine to have that in the toolbox for the once in six months weird requirement. But for the simple cases I do every day I want simple commands that each do one thing and have memorable names.


If I'm understanding you correctly, you can have both. If there are specific rebase types that you perform regularly, you can create aliases for them and give them whatever name is meaningful to you.

For example, I frequently use `jj up` to rebase the current branch on main. Likewise, `jj pop` rebases just the current commit (popping it from its current place). I even have a `jj ppop` - better name suggestions are welcome - which does this but for the parent commit.

I suspect that the once-off effort to write your own commands would take no longer than it would take to read the documentation if the commands already existed, but with the hopeful extra benefit of giving you a better understanding of how to use rebase for those once in six months weird requirements when they may arise.

But to be clear, I'm not suggesting you must or even should put in this effort if you have something that works for you. My reply is mostly so that anyone who comes across this discussion and sees Steve's mention of -A, -B, etc isn't scared off by them. Whilst they're always there for you, you can use the power it gives you but in the form of single function commands that don't require you to think.

---

For anyone wondering, the aliases I mentioned. These can be dropped in your jj config with `jj config edit --user`.

  [aliases]
  up = ["rebase", "--skip-emptied", "-d", "trunk()"]`
  pop = ["rebase", "-r", "@", "-d", "trunk()"]
  ppop = ["rebase", "-r", "@-", "-d", "trunk()"]


Most of the time in jj you don’t even rebase manually, because it’s automatic. And the vast majority of the time, I’m using one or two flags to rebase if I am calling it. You might even need only two in this case (before only might be fine?) I just use both before and after because it’s so easy to remember the names.

Anyway you should use the tools you like, it’s all good.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: