TODOs JJ Style
TODOs JJ Style
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.
TODOs JJ Style _______________________ < todo: fill out cowsay > ----------------------- \ ^^ \ (oo)_____ (__)\ )/\ ||----w | || || 我很喜欢使用 JJ,最近我发现了一种处理 TODO 的好方法,非常适合我。
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.
代码库内的 TODO 有点烦人。通常我会把它们放在一个 TODO.md 文件中,这很标准。但我很快就会忘记这个文件,也不太擅长记得去划掉已完成的事项。而且由于它在代码库中,我经常不想去更新它,随后就忘了。
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? 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.
空提交来救场。JJ 有一个很酷的功能,你可以在实际工作之前创建空变更,甚至为它们编写描述。那么,如果我把我以后想做的所有事情都做成空提交会怎样?挺不错的!当我想开始做某件事时,我会把它从我的 TODO 树中变基(rebase)出来,并放到其他变更上。当我进行更改时,我需要将我的“TODO 基础”向前变基,但因为它是一个空提交,所以永远不会有冲突,而且可以很容易地移动。依赖于其他 TODO 的 TODO 在这里也能自然地适配,我只需在其他空提交之上创建新的空提交即可。
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.
保持私密。我配置了 git.private-commits 以确保任何带有 private: 前缀的内容都不会被推送。这确保了我的 TODO 保留在本地系统中。当然,不这样做也有其好处。# 在 Home Manager 中… programs.jujutsu.settings.git.private-commits = “description(‘private:*’)”; 总之就是这样,虽然不是什么开创性的东西,但我很喜欢。