Skip to content

Commit

Permalink
demo git_compat: mention tracking branches and listing branches
Browse files Browse the repository at this point in the history
This topic is important now that `jj log` does not show branches
`jj git clone` says it fetched by default. 

I also added a sentence to the README to motivate branches
appearing in the demo.
  • Loading branch information
ilyagr committed Aug 8, 2024
1 parent 2b5595c commit abfb139
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 45 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ add functionality that cannot easily be added to the Git backend.

The Git backend is fully featured and maintained, and allows you to use Jujutsu
as an alternative interface to Git. The commits you create will look like
regular Git commits. You can always switch back to Git. The Git support uses the
[libgit2](https://libgit2.org/) C library.
regular Git commits. You can fetch branches from a regular Git remote and push
branches to the remote. You can always switch back to Git. The Git support uses
the [libgit2](https://libgit2.org/) C library.


<img src="demos/git_compat.png" />
Expand Down
17 changes: 15 additions & 2 deletions demos/demo_git_compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@ comment "Clone a Git repo:"
run_command "jj git clone https://github.com/octocat/Hello-World"
run_command "cd Hello-World"

comment "Inspect it:"
comment "By default, \"jj\" creates a local master branch tracking the remote master
branch. The other branches are only available as remote-tracking branches."
run_command "jj branch list --all"
comment "We can create a local branch tracking one of the remote branches we just
fetched."
run_command "jj branch track octocat-patch-1@origin"

comment "By default, \"jj log\" shows the commits jj considers \"ours\" together
with their parents."
run_command "jj log"

comment "We can also ask \"jj\" to show all the commits."
run_command "jj log -r 'all()'"
blank

comment "We can look at the commits in the repo"
run_command "jj diff -r b1"
run_command "jj diff -r b3"

comment "The repo is backed by the actual Git repo:"
run_command "git --git-dir=.jj/repo/store/git log --graph --all --decorate --oneline"
Expand Down
Loading

0 comments on commit abfb139

Please sign in to comment.