.Dd July 7, 2026 .Dt DIFFWISE 1 .Os .Sh NAME .Nm diffwise .Nd export jj commits as patch files for code review .Sh SYNOPSIS .Nm .Op Fl n .Op Fl o Ar directory .Op Fl r Ar revset .Sh DESCRIPTION .Nm exports a series of .Xr jj 1 commits as patch files, one file per commit, for mailing-list style code review: the reviewer opens a patch file and replies inline. .Pp By default .Nm exports the commits selected by the revset .Ql ::@ & mutable() , the working copy and its mutable ancestors. A different revset can be given with .Fl r . .Pp Commits are written oldest first into the current directory, or into the directory given with .Fl o . Each patch file contains an mbox-style .Ql From line carrying the commit id, followed by .Ql From , .Ql Date , and .Ql Subject headers taken from the commit author and description, .Ql Committer and .Ql Committer-Date headers identifying who committed the change - which differs from the author when a change is committed on someone else's behalf - the remainder of the commit description if any, and a .Ql --- separator line followed by the commit's changes in git diff format. When more than one commit is selected, subjects are numbered .Ql [PATCH n/m] . .Pp Files are named .Pa NNNN-subject.patch , where .Pa NNNN is the position of the commit in the series counting from 0001 and .Pa subject is the first line of the commit description with runs of characters other than letters and digits replaced by a single hyphen. Commits that have neither changes nor a description - such as an empty working-copy commit - are skipped and do not count toward the series numbering. A commit with no description but with changes produces a patch with an empty subject and a file named .Pa NNNN-patch.patch ; a commit with a description but no changes produces a patch with an empty diff. A revset that selects no commits produces no files. The path of each file is printed to standard output as it is written. .Sh OPTIONS The following options are supported by .Nm : .Bl -tag -width "-o directory" .It Fl n Dry run. Print the patch file names that would be written, without writing them or creating the output directory. .It Fl o Ar directory Write patch files into .Ar directory , creating it if it does not exist. The default is the current directory. .It Fl r Ar revset Export the commits selected by .Ar revset instead of the default .Ql ::@ & mutable() . .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Export the working copy and its mutable ancestors, one patch file per commit, into the current directory: .Dl % diffwise .Pp Export two specific commits into a separate directory: .Dl % diffwise -o ~/review/inbox -r 'wqnwkozp | tmzuqxpv' .Sh SEE ALSO .Xr jj 1