website/docs/overview/smartlog.md
import {SLCommand} from '@site/elements'
Forming a mental picture of a repository is one of the largest hurdles for users learning distributed version control. A poor mental model leads to people not understanding what commands actually do, not understanding how to recover from mistakes, not being able to use advanced features, and generally leads to people copy/pasting commands they’ve memorized and then recloning when things go awry.
Instead of requiring users to piece together the state of their repo via log, branch, etc, we built Smartlog and made it the centerpiece of Sapling’s user experience. As such, sl smartlog is one of the most important commands in Sapling as it lets you see the state of your local repo clearly and concisely, without having to learn multiple commands or maintain a complex mental model of the repository.
It shows you:
@).Smartlog provides you with a succinct view of your work by hiding all commits that aren’t relevant to you. In the example below, the dashed line on the left represents the main branch and elides thousands of commits to show you just the ones relevant to you.
Smartlog can be displayed via sl smartlog or by just running sl.
Sapling can also fetch information about the repository from external sources, such as checking GitHub to know if a pull request has passed automated tests and been reviewed. Since this extra information requires waiting a few seconds for network requests, we have a separate <SLCommand name="ssl" /> alias for this:
<pre> <span class="shell-prompt">></span> <span class="shell-command">sl ssl</span> o <span class="sl-public">bc3bbba5d</span> Yesterday at 12:23 <span class="sl-bookmark">remote/main</span> ╷ ╷ @ <span class="sl-draft">c7ed677ea</span> Today at 11:17 jane <span class="sl-review-unreviewed">#269 Unreviewed</span> <span class="sl-signal-failed">✗</span> ╷ │ <span class="sl-current">[docs] make examples consistent</span> ╷ │ ╷ o <span class="sl-draft">9f15ade1c</span> Today at 10:09 jane <span class="sl-review-unreviewed">#267 Unreviewed</span> <span class="sl-signal-okay">✓</span> ╷ │ [docs] syntax-highlighting for smartlogs ╷ │ ╷ o <span class="sl-draft">44df3afe6</span> Yesterday at 14:07 jane <span class="sl-review-approved">#264 Approved</span> <span class="sl-signal-okay">✓</span> ╭─╯ [docs] add sl-shell-example syntax-highlighting language │ o <span class="sl-public">ecf6ca5e1</span> Yesterday at 12:23 │ ~ </pre>An interactive smartlog GUI is available by running sl web. This shows similar information to sl smartlog while also refreshing automatically, and allows you to run commands or drag and drop commits to rebase them.