docs: emphasize and clarify log revsets relevant to people coming from git

I couldn't come up with a Git analogue of `jj log`, but I think it's OK
leaving it as a TODO makes the point. Perhaps somebody can figure it
out.

Also, all the correspondences are not completely precise, so I didn't
emphasize it every single time.
This commit is contained in:
Ilya Grigoriev 2024-01-31 12:32:10 -08:00
parent 7c87fe243c
commit fa123bbfee
2 changed files with 16 additions and 11 deletions

View file

@ -181,14 +181,19 @@ parent.
<td><code>git commit -a</code></td>
</tr>
<tr>
<td>See log of commits</td>
<td><code>jj log</code></td>
<td>See log of ancestors of the current commit</td>
<td><code>jj log -r ::@</code></td>
<td><code>git log --oneline --graph --decorate</code></td>
</tr>
<tr>
<td>Show log of ancestors of the current commit only, including all ancestors, not just stopping at immutable commits</td>
<td><code>jj log -r ::@</code></td>
<td><code>git log</code></td>
<td>See log of all reachable commits</td>
<td><code>jj log -r 'all()'</code> or <code>jj log -r ::</code></td>
<td><code>git log --oneline --graph --decorate --branches</code></td>
</tr>
<tr>
<td>Show log of commits not on the main branch</td>
<td><code>jj log</code></td>
<td>(TODO)</td>
</tr>
<tr>
<td>Search among files versioned in the repository</td>

View file

@ -227,6 +227,12 @@ Show the parent(s) of the working-copy commit (like `git log -1 HEAD`):
jj log -r @-
```
Show all ancestors of the working copy (like plain `git log`)
```
jj log -r ::@
```
Show commits not on any remote branch:
```
@ -239,12 +245,6 @@ Show commits not on `origin` (if you have other remotes like `fork`):
jj log -r 'remote_branches(remote=origin)..'
```
Show all ancestors of the working copy (almost like plain `git log`)
```
jj log -r ::@
```
Show the initial commits in the repo (the ones Git calls "root commits"):
```