-
Notifications
You must be signed in to change notification settings - Fork 745
docs: add coming from git guide #7704
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. |
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 following commits do not follow our format for subject lines:
- a8ae7c9: Add Coming from Git guide in docs
Commits should have a subject line following the format <topic>: <description>
. Please review the commit guidelines for more information.
I haven't looked at this yet but could you explain how it relates to https://jj-vcs.github.io/jj/latest/tutorial/ (which targets current Git users) and https://jj-vcs.github.io/jj/latest/github/? |
From the 0.34.0 CHANGELOG:
|
thanks, both, for reviewing so quickly! @joyously awesome, thanks! I will adjust @martinvonz sure! I can explain. I wrote this guide for people who have read about jujutsu and understood the basic idea and want to get started immediately with their working projects. comparing to the tutorial page (https://jj-vcs.github.io/jj/latest/tutorial/), the guide in this PR:
comparing to the github page (https://jj-vcs.github.io/jj/latest/github/), the guide in this PR:
the main motivation for writing this guide came because I had a friend explain to me how jujutsu works, but then I found no tutorial on how to start using it in my existing local repository. I think this guide would work well in addition to the existing tutorial, not replacing it, maybe with a title such as "Full lifecycle tutorial". let me know what you think! happy to make changes, I only submitted this because nothing else I read was useful at this point of my jujutsu experience -- but that's just me! |
a8ae7c9
to
cd8afe7
Compare
All commits are now correctly formatted. Thank you for your contribution!
cd8afe7
to
ca66caf
Compare
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.
Here are some initial comments. cc @ilyagr since he has looked at most larger doc PRs.
While I like the idea, it certainly lacks a bit of polish and I'm not sure yet how to integrate it into existing documentation.
ca66caf
to
e15995d
Compare
Perfect, thank you @PhilipMetzger! These were all valuable suggestions. I've updated the document with some additional changes as well, and I added an overview section too, which includes the blog post that inspired me to get back to Jujutsu and write this guide. |
docs/guides/coming-from-git.md
Outdated
jj describe | ||
``` | ||
|
||
Awesome! Jujutsu auto-commits on every file save (with empty commit messages), so |
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.
I think this gives the wrong impression: "every file save" would have to be tied to the editor or using some file monitor. Isn't it simply that every jj
command does a snapshot first?
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.
Ah, right. Let me try to fix that.
docs/guides/coming-from-git.md
Outdated
jj log | ||
``` | ||
|
||
to see current and previous commits along with messages and bookmarks. |
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 default revset for jj log
often doesn't show much, so this can be misleading.
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.
I see, fixing.
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.
Is it true to say this?
You can always do
jj log
to see the most recent relevant commits (i.e. working copy commit and ancestor plus any other mutable — unpushed — commits) along with messages and any bookmarks on
those commits.
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.
Is it true to say this?
I don't know, but it's the long way around, if you don't mention revsets or default log parameters. Either way, it's more than is needed for your explanation.
My own experience with this is that I don't know the revset stuff, and the log
command doesn't show much by default, so it feels really frustrating or that the tool lost all the commits.
docs/guides/coming-from-git.md
Outdated
|
||
Ok, work done, how to push? | ||
|
||
`jj` does not have branches, it has `bookmarks`. Branches are like tree branches: |
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.
jj
does not have branches,
I like your explanation except this phrase, because the graph does branch. Also because a deleted branch in Git is abandoned in jj
, isn't it?
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.
Right, thanks! What does "abandoned in jj" mean? Does it mean it's no longer accessible? I'll change this sentence to:
We don't push branches in Jujutsu as we do in Git. Instead, we push
bookmarks
.
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.
What does "abandoned in jj" mean?
To me it means "the result of the abandon
command". I don't know what is going on underneath.
e15995d
to
ad82187
Compare
Thanks @joyously! These were great suggestions. I think how we can integrate this into the existing documentation remains an open question though. I just saw there is also another similar PR from 2 days ago: #7754 I wonder if we can somehow include different approaches but at the same time make it clear which one is for whom 🤔 |
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.
another minor round
docs/guides/coming-from-git.md
Outdated
jj bookmark set fix-login -r @ | ||
# this means I set a new bookmark in the latest/current commit (signified by @) |
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.
nit: In both this example and the next one you use bookmark set
which has upserting behavior if you mistype the bookmark name. It should be jj bookmark move <name>
which avoids this failure mode.
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.
I had the thought to use jj bookmark create
for the first one. I'll do that and then use move
for the second example.
docs/guides/coming-from-git.md
Outdated
# prepare new commit following the last one, part of fix-login branch | ||
``` | ||
|
||
...and that's the end of a standard GitHub workflow. |
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.
nit: "end of a standard GitHub workflow" => "end of the standard GitHub workflow" since there's only one
docs/guides/coming-from-git.md
Outdated
> concepts. In addition to this documentation, this | ||
> [blog post by Stavros](https://www.stavros.io/posts/switch-to-jujutsu-already-a-tutorial/) | ||
> is also recommended as a resource for familiarizing oneself with the basic | ||
> concepts. |
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.
optional: I'd prefer if we linked out to our tutorial and then link to stavros tutorial there.
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.
sure! let me change that
Comparing to the existing getting started tutorial, this "Coming from Git" guide: * Goes farther and explains a full code change lifecycle * Assumes the reader is already familiar with the basic jujutsu concepts * Assumes an existing local git repository * Integrates GitHub as part of it and follows the GitHub PR flow * Each step is designed to be concise, focusing on a single concept/task * Has the purpose of allowing someone to use jujutsu immediately and figure out the rest of the stuff as they go
ad82187
to
d4cb140
Compare
This is a new guide for learning jujutsu.
I finally made sense of how I can use jujutsu to fit a/the standard github flow. I know there are tons of opinionated guides but I felt this was missing and didn't find it anywhere else. Also, I think it should be part of the official docs -- so here it is!