ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

338 commits

Author SHA1 Message Date
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
Yuya Nishihara
089503abfb refs: classify push action based on tracking target
Although this is logically correct, the error message is a bit cryptic. It's
probably better to reject push if non-tracking remote branches exist.

#1136
2023-10-17 15:06:03 +09:00
Yuya Nishihara
e0965c4533 git: on push, update jj's view of remote branches without using import_refs()
This means that the commits previously pinned by remote branches are no longer
abandoned. I think that's more correct since "push" is the operation to
propagate local view to remote, and uninteresting commits should have been
locally abandoned.
2023-10-17 15:06:03 +09:00
Yuya Nishihara
9cafff87e1 cli: add API and branch subcommand to track/untrack remote branches
This patch adds MutableRepo::track_remote_branch() as we'll probably need to
track the default branch on "jj git clone". untrack_remote_branch() is also
added for consistency.
2023-10-16 23:21:05 +09:00
Yuya Nishihara
4cd2518be0 git: on import_refs(), respect tracking state of existing remote refs
In this commit, new behavior is tested by using in-memory view data. Data
persistence and track/untrack commands will be implemented soon.
2023-10-16 23:21:05 +09:00
Infra
56a1686925 Add build-essential to install instructions 2023-10-05 09:07:37 -07:00
Ilya Grigoriev
048f993a17 docs index.md: explain that the website sidebar may be hidden
This happens on mobile browsers or when the browser window is too
narrow.
2023-10-04 05:25:37 -07:00
Ilya Grigoriev
7cfeb72328 docs index.md: Make README link a bit more reliable
The original link would likely be broken by the change to
the heading title in https://github.com/martinvonz/jj/pull/2273.
2023-10-04 00:22:12 -07:00
Ilya Grigoriev
2218143968 docs: create a basic homepage for the docs website
Before, https://martinvonz.github.io/jj/latest redirected to
https://martinvonz.github.io/jj/latest/install-and-setup.html.

Now, it will direct people to a basic page with a link to
the repo and a few other useful pages.

An additional motivation is the desire to have a homepage to
link to from
https://github.com/martinvonz/jj/pull/2273#discussion_r1331008117.

Better something very basic than nothing.
2023-10-03 19:58:22 -07:00
Waleed Khan
d9597c55ec docs: use code block for ui.pager config example 2023-10-02 23:37:33 -05:00
Yuya Nishihara
ce0821f06d docs: adjust tracking branches design to deal with "fetch/push && undo"
The original idea was to completely replace git_refs with remotes["git"] by
introducing "forgotten" state, but it turned out to break "fetch && undo"
scenario. There are other ways around, but they also have problems:

* Sets tombstone on forgotten/deleted remote refs, exports remote refs without
  comparing to the known refs.
  * `jj undo` would need to insert tombstone by diffing old/new views.
  * `jj branch forget` would need to preserve the @git branch whereas the other
    remote branches would be forgotten.
* Always overwrites remote refs on export.
  * `jj git export` without importing would discard remote refs.

So, I decided to not remove git_refs. Apparently, it also improves the undo
behavior. In the new model, `jj git fetch && jj undo && jj git fetch` works
even if git_refs isn't rolled back. So we can unify the default of
`jj undo --what`.
2023-09-28 18:00:25 +09:00
Philip Metzger
e158423cb0 Docs: Make github.md a bit clearer
This adresses #1989
2023-09-28 01:11:47 +02:00
Emily Fox
35f11e2cdc docs: add missing word to config.md 2023-09-27 12:26:08 -05:00
Hong Shin
e5ad32e29e docs: update basic workflow to use autogenned branch name 2023-09-26 13:16:44 -07:00
Hong Shin
0c0b924e7a docs: add revset clarification to github.md 2023-09-26 10:59:38 -07:00
Martin von Zweigbergk
a6ef3f0b6c cli: make set of immutable commits configurable
This adds a new `revset-aliases.immutable_heads()s` config for
defining the set of immutable commits. The set is defined as the
configured revset, as well as its ancestors, and the root commit
commit (even if the configured set is empty).

This patch also adds enforcement of the config where we already had
checks preventing rewrite of the root commit. The working-copy commit
is implicitly assumed to be writable in most cases. Specifically, we
won't prevent amending the working copy even if the user includes it
in the config but we do prevent `jj edit @` in that case. That seems
good enough to me. Maybe we should emit a warning when the working
copy is in the set of immutable commits.

Maybe we should add support for something more like [Mercurial's
phases](https://wiki.mercurial-scm.org/Phases), which is propagated on
push and pull. There's already some affordance for that in the view
object's `public_heads` field. However, this is simpler, especially
since we can't propagate the phase to Git remotes, and seems like a
good start. Also, it lets you say that commits authored by other users
are immutable, for example.

For now, the functionality is in the CLI library. I'm not sure if we
want to move it into the library crate. I'm leaning towards letting
library users do whatever they want without being restricted by
immutable commits. I do think we should move the functionality into a
future `ui-lib` or `ui-util` crate. That crate would have most of the
functionality in the current `cli_util` module (but in a
non-CLI-specific form).
2023-09-25 15:41:45 -07:00
Waleed Khan
409356fa5b merge_tools: enable :builtin as default diff/merge editor 2023-09-21 03:29:27 +02:00
Ilya Grigoriev
6d5390d1db cli: add upstream remote to default trunk()
This makes trunk() correct after `jj git fetch --remote upstream --branch
main`.
2023-09-19 20:51:23 -07:00
Ilya Grigoriev
0c31e0ba61 trunk() docs fix: commits aren't tried in order; newest commit wins
That's my understanding of how `latest()` revset works.
2023-09-19 20:51:23 -07:00
Yuya Nishihara
96cb3a6053 docs: use branch@remote syntax in trunk() example
It's simpler, and user-specified trunk() wouldn't need fallback.
2023-09-19 21:29:08 +09:00
Ruben Slabbert
f2f5ded5f0 revsets: add trunk alias with default to main/master/root 2023-09-17 10:17:23 +10:00
Ilya Grigoriev
c45216ed02 templates.md docs: Document string literal format
We are a little weird about which string escapes we support, and we don't
support raw strings.  I thought this might be worth documenting.

Inspired by https://github.com/martinvonz/jj/pull/2251
2023-09-15 20:16:09 -07:00
Ilya Grigoriev
c5f74bc466 docs: mention git pack-refs for co-located repos
As suggested by @yuja in
https://github.com/martinvonz/jj/issues/1841#issuecomment-1720451152

Thanks to @lazywei for pointing out that `git pack-refs --all` is better, at
least on the first run. I haven't checked, but suspect, that because of the
number of `refs/jj` refs jj creates, it might always be better.
2023-09-15 19:49:11 -07:00
Martin von Zweigbergk
21921cfd73 docs: add a section about profiling 2023-09-14 21:15:03 -07:00
Philip Metzger
09a99e36dc docs/design: Clarify run.md a bit.
This is essentially a new version, which clarifies multiple statements about
`jj run`. Notably, it cleans up some mistakes which were overlooked or deemed
good enough in the Google Docs version.
2023-09-14 16:39:40 +02:00
Philip Metzger
5b729a90a9 docs/design: Move the run doc to github.
This ticks another box in #1869.

Co-Authored-By: arxanas <me@waleedkhan.name>
Co-Authored-By: hooper <hooper@google.com>
Co-Authored-By: martinvonz <martinvonz@google.com>
2023-09-14 16:39:40 +02:00
Glen
2c74fa8c7c docs: document script to colocate a jj-only repo
https://github.com/martinvonz/jj/discussions/2230 indicates a lot of
interest in this, so we'd probably want to support this officially at
some point. Until then, document a script that has worked well-enough
for some of us.
2023-09-14 10:00:39 +08:00
Ilya Grigoriev
0cf83ea306 contributing.md: add section about contributing to the docs 2023-09-11 18:22:56 -07:00
Ilya Grigoriev
21f4015cbf install-and-setup.md: explain how to compile the latest release
Also a few minor updates.
2023-09-11 18:21:56 -07:00