Commit graph

366 commits

Author SHA1 Message Date
Martin von Zweigbergk
63c4de3cf7 docs: try to clarify that jj doesn't need a staging area
Wol on lwn.net pointed out that our current description in the Git
Comparison doc for why there is no staging area can be interpreted as
saying that it's because it simplifies the CLI. It took me a while to
see that interpretation, but it makes sense to me now. This patch
tries to clarify that we have better tools than the staging area for
manipulating commits.
2024-01-22 15:47:24 -08:00
Martin von Zweigbergk
fc2b595098 git-comparison: explain why equivalent of git stash is not needed
Someone felt that our "Not needed" sounded dismissive. This patch
tries to clarify that it's the *command* (not the use case) we
consider not needed.
2024-01-21 21:13:19 -08:00
Ilya Grigoriev
0e817f7576 docs contributing.md: document using mold linker with nextest
On my machine, this halves the time taken by `cargo insta test --workspace
--test-runner nextest`.

I don't believe there would be a worthwhile improvement when not
using `nextest`. I also documented how to tell whether using `mold`
is worthwhile.

I was reminded of this by https://github.com/martinvonz/jj/pull/2858.
2024-01-21 19:28:37 -08:00
Martin von Zweigbergk
ed3c95cde6 docs: clarify that while named branches are not needed, they are supported
The "No need for branch names" can be interpreted as implying that we
don't support named branches, which is of course not true. Try to
clarify it.
2024-01-20 08:33:28 -08:00
Martin von Zweigbergk
41db64e63c cli: give root operation special treatment in template (like root commit) 2024-01-14 10:15:14 -08:00
Valentin Gatien-Baron
8783a05551 doc: suggest ripgrep as an equivalent of git grep
Sadly, ripgrep won't honor the .gitignore files in the absence of a
.git directory, so we need to pass an annoying flag (for non-colocated
repos).

That seems worth adding despite the existing suggestion, because rg is
faster, and for existing users for rg, it would teach them how to make
rg work as expected.
2024-01-12 17:01:14 -05:00
Valentin Gatien-Baron
f0dd311354 docs: add git comparison for jj workspace root
To make the jj command more discoverable.
2024-01-11 07:45:13 -05:00
vwkd
e41ef56e83 docs: update CLI output in Tutorial 2024-01-08 19:59:59 +04:00
Yuya Nishihara
614b289ff5 docs: reorder and partially rewrite remote branches section to reflect changes
The <branch name>@<remote name> explanation is moved to the top because
otherwise it's uneasy to introduce a "tracking" concept.
2024-01-04 10:57:27 +09:00
Philip Metzger
a6e1bc8309 docs: Add branch tracking to branches.md.
This tries to explain Jujutsu's branch tracking for a newcomer. 
It is based on it's design doc in `docs/design/tracking-branches.md`.
2024-01-02 22:14:01 +01:00
Yuya Nishihara
3eafca65ea op_walk: add support for op_id+ (children) operator
A possible use case is when doing some archaeology around a certain operation.

The current implementation is quadratic if + is repeated. Suppose op_id is
usually close to the current op heads, I think it'll practically work better
than building a reverse lookup table.
2024-01-02 10:30:08 +09:00
Philip Metzger
c2973fdf9a FAQ: Describe how to integrate with Gerrit.
This question is mildly popular on Discord so it's finally time to have an answer.

We should do something better in the future but the current solution is good enough for today.

cc @thoughtpolice
2024-01-01 21:08:19 +01:00
Gabriel Scherer
dafc900cca git comparison: include a 'git grep' equivalent 2023-12-21 00:20:45 +01:00
Ilya Grigoriev
9a990ad92f docs config.md Vim instructions: link to the Wiki instead of a gist 2023-12-17 22:16:02 -08:00
Yuya Nishihara
87a8238bee git: turn git.auto-local-branch off by default
As far as I can see in the chat, there's no objection to changing the default,
and git.auto-local-branch = false is generally preferred.

docs/branches.md isn't updated as it would otherwise conflict with #2625. I
think the "Remotes" section will need a non-trivial rewrite.

#1136, #1862
2023-12-17 08:30:24 +09:00
Yuya Nishihara
5a466cab4c cli: ensure default remote branch is imported by "git clone"
I originally thought this would be unavoidable, but I was wrong. "jj git clone"
doesn't implicitly create any local branch if git.auto-local-branch is off, and
that's fine because the detached HEAD state is normal in jj.

That being said, Git users would expect that the main/master branch exists.
Since importing the default branch is harmless, let's create and track it no
matter if git.auto-local-branch is off.
2023-12-16 16:02:10 +09:00
Martin von Zweigbergk
1cc271441f gc: implement basic GC for Git backend
This adds an initial `jj util gc` command, which simply calls `git gc`
when using the Git backend. That should already be useful in
non-colocated repos because it's not obvious how to GC (repack) such
repos. In my own jj repo, it shrunk `.jj/repo/store/` from 2.4 GiB to
780 MiB, and `jj log --ignore-working-copy` was sped up from 157 ms to
86 ms.

I haven't added any tests because the functionality depends on having
`git` binary on the PATH, which we don't yet depend on anywhere
else. I think we'll still be able to test much of the future parts of
garbage collection without a `git` binary because the interesting
parts are about manipulating the Git repo before calling `git gc` on
it.
2023-12-03 07:40:12 -08:00
Martin von Zweigbergk
ec7f9e79f6 docs: update description of conflicts to be about tree-level conflicts
Fixes #2373
2023-11-30 14:24:48 -08:00
Jason R. Coombs
e7ae1f9c0b Replace contact method with addresses of active leads. 2023-11-28 13:48:22 -05:00
Jason R. Coombs
e76189ebe1 Update code of conduct, copied unmodified from upstream (https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). 2023-11-28 13:48:22 -05:00
Jesse Somerville
8fac33afdb install-and-setup.md: --strategy -> --strategies for cargo binstall 2023-11-21 20:19:38 -08:00
Benjamin Saunders
78cdc0843a docs: add forgotten code tags 2023-11-14 14:48:44 -08:00
Benjamin Saunders
257fbe35c7 docs: Document jj backout/git revert correspondence 2023-11-13 18:10:03 -08:00
Łukasz Kurowski
e4955d29f3 git-comparison.md: show log of ancestors
This question was raised on the discord, it might be helpful for others.
2023-11-11 15:24:24 +01:00
Yuya Nishihara
2ac9865ce7 revset: exclude @git branches from remote_branches()
As discussed in Discord, it's less useful if remote_branches() included
Git-tracking branches. Users wouldn't consider the backing Git repo as
a remote.

We could allow explicit 'remote_branches(remote=exact:"git")' query by changing
the default remote pattern to something like 'remote=~exact:"git"'. I don't
know which will be better overall, but we don't have support for negative
patterns anyway.
2023-11-08 07:34:30 +09:00
Ilya Grigoriev
745f5b7f0e poetry: Poetry 1.7 issues
1. Add --no-root to poetry invocations. Poetry 1.7 displays an error otherwise
(though things still work)

https://github.com/orgs/python-poetry/discussions/8622
https://github.com/python-poetry/poetry/issues/1132

2. Document https://github.com/python-poetry/poetry/issues/8623
2023-11-06 17:10:27 -08:00
Martin von Zweigbergk
9a5c19a3c6 contributing.md: suggest making the gh-pages branch immutable 2023-11-05 08:07:02 -08:00
Martin von Zweigbergk
7c923514ee git: add config to disable abandoning of unreachable commits
Some users prefer to have commits not get abandoned when importing
refs. This adds a config option for that.

Closes #2504.
2023-11-05 06:10:54 -08:00
Ilya Grigoriev
adc8433204 mkdocs: make MkDocs work with more GitHub-like list formatting
This adds two MkDocs extensions to make list handling more flexible.
It took some trial-and-error, but it seems this config works OK.

revsets.md: use saner formatting that is now possible.

sapling-comparison.md: this was the one case I saw made worse by the
new plugins. I changed the Markdown formatting, it still looks sane.
2023-11-03 19:15:37 -07:00
Philip Metzger
c783bbce6d FAQ: Add an entry on how Jujutsu saves changes in the working-copy.
This was brought up as a common point of confusion in a Discord discussion ~2 
months ago.
2023-11-02 20:29:06 +01:00
Tal Pressman
6b1217ec6d add FAQ for divergent changes 2023-11-01 16:55:57 +09:00
Ilya Grigoriev
0df851e6e2 glossary.md: Add a stub for "Hidden commits, Abandoned commits" 2023-10-31 23:41:41 -07:00
Ilya Grigoriev
c79920095b glossary.md: Clarify description of "visible commits" 2023-10-31 23:41:41 -07:00
Ilya Grigoriev
4c490d2ca9 revsets.md: correct description of "visible commits" 2023-10-31 23:41:41 -07:00
Ilya Grigoriev
a3f21f7a9d revsets.md: clarify string patterns and file patterns
I had to increase indent on two list items for multiple paragraphs to work in
MkDocs.
2023-10-31 17:49:49 -07:00
Ilya Grigoriev
38daa9abe3 install-and-setup.md: Document binary installation with cargo-binstall
I also mentioned this in the changelog, since people reading it are more likely
to use `binstall` than most.
2023-10-30 15:12:23 -07:00
Ilya Grigoriev
2cd262def3 install-and-setup.md: Make headings more consistent 2023-10-30 15:12:23 -07:00
Yuya Nishihara
0e14a1f04d templater: add local/remote_branches keywords 2023-10-28 11:03:23 +09:00
Yuya Nishihara
01d474563e templater: make branches, tags, git_refs, and git_head return list type
I'm not going to change the default output, but this allows us to highlight
or dim only the @remote component.
2023-10-28 05:29:50 +09:00
Yuya Nishihara
2b33a97c35 templater: add types for local/remote ref names
Both local and remote refs are backed by the same value type since we'll need
some kind of runtime abstraction to represent "branches" keyword (which is a
list of local + remote branches.) It's tedious to implement separate
local/remote/both ref types.

The "unsynced" flag is inverted just because the positive term is slightly
easier to document.
2023-10-28 05:29:50 +09:00
Yuya Nishihara
b30d5bf1c7 templater: allow implicit list-to-boolean cast
I'm going to change "branches" to return a list instead of formatted string,
and I don't think "if(branches, ..)" should be invalidated by that. Perhaps,
a container type like String, Vec<T>, Option<T> can implement the cast.
2023-10-28 05:29:50 +09:00
Ilya Grigoriev
b6eb00d5ff docs/config.toml: update the default diff editor
It's been changed to `:builtin` some time ago.
2023-10-25 13:05:04 -07:00
Ilya Grigoriev
fcd02a6091 merge_tools.toml: add VS Code as a default merge tool.
Thanks to @glencbz for noticing that VS Code works fine now as a
merge tool, and thanks to @solson for suggesting
`merge-tool-edits-conflict-markers = true`.
2023-10-25 12:47:51 -07:00
Martin von Zweigbergk
3a7d21043e docs: fix broken Markdown in github.md, plus various cleanups
While fixing the broken Markdown, I also went through the whole doc
and made various little improvements (hopefully).

Closes #2426.
2023-10-24 21:31:51 -07:00
Martin von Zweigbergk
171896aefa docs: mention the immutable_heads() in our list of built-in aliases 2023-10-23 12:05:09 -07:00
Gabriel Scherer
b0048bca17 tutorial.md: no need to mention heads(x) anymore
Instead we point explicitly at the full documentation on revsets.

Suggested-by: Martin von Zweigbergk <martinvonz@google.com>
2023-10-23 12:01:17 +02:00
Gabriel Scherer
8ade4d083a docs/tutorial.md: introduce both long and short names of each option 2023-10-23 12:01:17 +02:00
Waleed Khan
aacad9dc8c docs: discuss jj commit -i in FAQ.md 2023-10-22 15:37:41 -07:00
Yuya Nishihara
cfcc76571c revset: add support for glob:pattern 2023-10-21 09:55:01 +09:00
Ilya Grigoriev
8762a2274f git-compatibility.md: adjust instructions to convert to colocated repo to match 872265a22 2023-10-18 19:45:47 -07:00