GitXplorerGitXplorer
c

jj-gpc

public
11 stars
2 forks
1 issues

Commits

List of commits on branch main.
Verified
66c9926a884cedffbb9e5c241a3ce276808ce44b

Create FUNDING.yml

cchriskrycho committed a month ago
Unverified
69044d78c6898ee9be9e4467cbd03bd7e663323c

v0.6.0

cchriskrycho committed a month ago
Unverified
f3400cd384bebbb1b31447ad5baf5ae17245892c

docs: make sure CLI docs are complete sentences!

cchriskrycho committed a month ago
Unverified
fd2858dfdc56b59aadef1d7aae7f972ecd760513

infra: loosen all version constraints and `cargo update`

cchriskrycho committed a month ago
Unverified
9015c865d48bc6a1358d8606684119f0c346680c

docs: update README for the tweaks to the CLI

cchriskrycho committed a month ago
Unverified
29d92c267d1273599742a27cc164d3c2ca42ba6b

Use `phi3` rather than the more specific model name

cchriskrycho committed a month ago

README

The README file for this repository.

jj-gpc

✨ 100% local LLM-based bookmark (Git branch) name creation for Jujutsu VCS

Jujutsu is a modern, Git-compatible VCS. 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”).

gpc is short for git push change.

Installation

Prerequisites: a relatively recent version of Rust. (I built it with Rust 1.82, but it probably works with versions quite a bit earlier than that!)

  • Clone the repo.

    With Jujutsu:

    jj git clone https://github.com/chriskrycho/jj-gpc

    With Git:

    git clone https://github.com/chriskrycho/jj-gpc.git
  • Install it with Cargo:

    cargo install --path . --locked
  • Install and run ollama.

  • Fetch the phi3 model:

    ollama pull phi3

That’s it; now you can run jj-gpc to do this.

Usage

jj-gpc [change] [flags]

change is the revset to use to generate the bookmark name. If not passed, it will use @.

A few of the most useful flags:

  • -f/--from: the initial revision to use in the revset for generating the name. Note that the revset is of the form <from>..<change>, so the <from> message will not be included, because the default is trunk(), and the point is to generate a description of what is different from the trunk.
  • -p/--prefix: apply a prefix before the generated bookmark name. For example, jj-gpc -p chriskrycho would produce a name like chriskrycho/did-some-stuff, instead of just did-some-stuff.
  • --log-format: pass one-line (the default) to pass just summary messages, or full to pass the whole commit message, to the LLM for branch name description.
  • --dry-run: generate a branch name but neither create the bookmark nor push it.

For the full set of flags and more details, run jj-gpc --help!

Example output

A handful of branch names I have actually seen generated by this:

  • update-infra-issues
  • update-mdbook-dependencies
  • software-updates-implemented
  • cleaning-and-fixes
  • small-bug-fixes
  • small-code-updates
  • add-some-examples
  • small-digital-notebook
  • fix-library-errors
  • bump-typescript-version
  • support-ts-versions