-
Notifications
You must be signed in to change notification settings - Fork 832
docs: Add ASCII graphs to interdiff, squash, and duplicate help #8164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
cli/src/commands/duplicate.rs
Outdated
| /// \ \ / | ||
| /// E A E | ||
| /// ``` | ||
| /// (duplicating C onto D with `jj duplicate C --onto D`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text describes multiple duplicates, but the graph shows one duplicate and a move or something else. Is this graph correct? If so, improve the text so it matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Updated the graph to show C being duplicated to C' with both sharing the same parent B, and added explanatory text.
cli/src/commands/squash.rs
Outdated
| /// C C | ||
| /// | => | | ||
| /// B B' (contains changes from both B and C) | ||
| /// | | ||
| /// A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A novice is left thinking that A was deleted, and C remains even though empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Updated with Before/After format showing that C is abandoned and B' contains both B's and C's changes. A remains in the graph.
c6b8fb7 to
8a298bf
Compare
This addresses jj-vcs#3687 by adding visual ASCII diagrams to the help text of commands that work with commit graphs: - interdiff: Shows how commits are compared by rebasing - squash: Shows how changes are moved between commits - duplicate: Shows how commits are copied onto their parents or new destinations Added #[command(verbatim_doc_comment)] to preserve the ASCII art formatting. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
8a298bf to
ac4445b
Compare
|
Thanks for the feedback @joyously! I've updated the graphs to address your concerns: duplicate.rs:
squash.rs:
Please let me know if the updated graphs are clearer now! |
Much clearer, thanks. (I'm not the one to check for accuracy, though.) |
Summary
This PR addresses #3687 by adding visual ASCII diagrams to the help text of commands that work with commit graphs.
Changes
Added ASCII graphs to:
jj interdiffShows how commits are compared by temporarily rebasing one onto the other's parent:
jj squashShows how changes are moved from one commit to its parent:
jj duplicateShows how commits are copied:
Also added
#[command(verbatim_doc_comment)]attribute to preserve the ASCII art formatting in the help output.