Skip to content

Commit

Permalink
docs: emphasize and clarify log revsets relevant to people coming fro…
Browse files Browse the repository at this point in the history
…m 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.
  • Loading branch information
ilyagr committed Jan 31, 2024
1 parent 7c87fe2 commit fa123bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 10 additions & 5 deletions docs/git-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 6 additions & 6 deletions docs/revsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,22 @@ Show the parent(s) of the working-copy commit (like `git log -1 HEAD`):
jj log -r @-
```

Show commits not on any remote branch:
Show all ancestors of the working copy (like plain `git log`)

```
jj log -r 'remote_branches()..'
jj log -r ::@
```

Show commits not on `origin` (if you have other remotes like `fork`):
Show commits not on any remote branch:

```
jj log -r 'remote_branches(remote=origin)..'
jj log -r 'remote_branches()..'
```

Show all ancestors of the working copy (almost like plain `git log`)
Show commits not on `origin` (if you have other remotes like `fork`):

```
jj log -r ::@
jj log -r 'remote_branches(remote=origin)..'
```

Show the initial commits in the repo (the ones Git calls "root commits"):
Expand Down

0 comments on commit fa123bb

Please sign in to comment.