Last night and this morning I built a tiny new tool for my own purposes, called jj-gpc, where gpc is short for git push --create. Jujutsu is a modern,

New Tool: jj-gpc — Sympolymathesy, by Chris Krycho

submited by
Style Pass
2024-11-28 21:30:01

Last night and this morning I built a tiny new tool for my own purposes, called jj-gpc, where gpc is short for git push --create.

Jujutsu is a modern, Git-compatible version control system. (I wrote a nice long introduction to it early this year — a few details are outdated, but the big picture is as it was then, but even nicer.) It supports, and I primarily use, anonymous branches for development. Since Git, and thus all Git-based “ forges” (GitHub, GitLab, Bitbucket, etc.) require branch names, though, you need to give a branch name when you push your changes for others to work with.

Jujutsu has native support making this easy. If you run jj git push --change <change ID>,it creates a Jujutsu bookmark (which it maps to Git branches) and then pushes that newly created bookmark. The bookmark names it creates are of the form push-<change id>, though. Those are not especially attractive to most collaborators!

This tiny tool is one “ solution”: it generates a bookmark name based on the messages associated with the changes you tell it to use — by default, trunk()..@, or “ everything between my current working copy and whatever the ‘ trunk’ is for this project (usually main or master ” ).

Leave a Comment