Newshot

TODOs JJ Style

Original text(via Lobsters)

TODOs JJ Style


        _______________________
< todo: fill out cowsay >
 -----------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
      

I love using JJ and recently I’ve found a cool way to handle TODOs that works for me.

In-Tree TODO is Kinda Annoying

Usually I’ll put them in a TODO.md file which is pretty standard. But, I forget about this file quickly and am not very good at remembering to cross stuff off. Also since it’s in-tree I’ll often not want to update it, and then forget to do so later.

Empty Commits to the Rescue

JJ has a cool feature where you can make empty changes, and even write descriptions for them before actually doing work. So what if I just make all the stuff I wanna do later as empty commits?

A JJ tree showing a branch of empty commits, the root is called “private: TODO base” and has many empty children with descriptions
A JJ tree showing a branch of empty commits, the root is called “private: TODO base” and has many empty children with descriptions

Pretty nice! When I want to start working on something I’ll rebase it out of my TODO tree and onto some other change.

I need to rebase my “TODO base” forward when i make changes, but because it’s empty it will never have conflicts and can pretty easily move around.

TODOs that depend on other TODOs also naturally fit here, I just make new empty commits on top of other empty commits.

Keeping Them Private

I have git.private-commits configured to make sure nothing with the private: prefix will get pushed. This ensures my TODOs stay on my local system. Of course, there are benefits to not doing this.


        # In Home Manager...

programs.jujutsu.settings.git.private-commits = "description('private:*')";
      

Anyway that’s about it, not very ground breaking but something I like.

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Lobsters
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗