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

524 commits

Author SHA1 Message Date
Yuya Nishihara
02eb164dae config: migrate "config get"/"set" to TOML-based name argument parsing 2024-05-23 12:22:12 +09:00
Matt Stark
fa6f5e3880 Add the revsets mutable and immutable.
I add them as aliases, since a user may instead choose to define `immutable_heads()`, for example, as `heads(immutable())`, and the define `immutable()` instead.
2024-05-22 09:19:46 +10:00
dploch
a49da4ad01 revset: implement a 'reachable(src, domain)' expression
This revset correctly implements "reachability" from a set of source commits following both parent and child edges as far as they can go within a domain set. This type of 'bfs' query is currently impossible to express with existing revset functions.
2024-05-21 10:52:31 -04:00
Remo Senekowitsch
c9375bf76f docs: fix converting a repo into a co-located one
`jj st` doesn't add the file `.git/refs/heads/main` so the git repo is left
in an invalid state. `jj new @-` puts the git repo in a valid state.
2024-05-20 21:39:27 +09:00
Waleed Khan
6eefad9b67 docs: Add Log header
There are six related settings that would be good to group in the table of contents.
2024-05-18 16:39:28 -07:00
Martin von Zweigbergk
8e0ac1d167 docs: conflicted branches have two "?" as suffix
Looks like we forgot to update this when we changed from one to two
question marks.
2024-05-17 07:00:15 -07:00
Ilya Grigoriev
0d0f8af05d docs CLI reference: explain that argument help is truncated
Perhaps this will help with issues like
https://github.com/martinvonz/jj/issues/3667
2024-05-15 09:45:40 -07:00
Ilya Grigoriev
c9b44f3828 docs: ask MkDocs to fail on links to non-existent sections
This also requires anchors to be lower-cased: https://github.com/mkdocs/mkdocs/issues/3703
2024-05-14 13:14:27 -07:00
tinger
d0a29a831d cli: add ui.color = "debug"
When using `ui.color = "debug"`, changes in the output style
additionally include delimiters << and >>, as well as all active labels
at this point separated by ::. The output is otherwise unformatted and
the delimiters and labels inherit the style of the content they apply
to.
2024-05-11 10:16:09 +02:00
Yuya Nishihara
8e4f75552d templater: add tracking methods to remote RefName
More tests will be added later as "branch list" templates.

In "log" template, we might want to see the number of "local" commits ahead
of any tracked remotes. It can be implemented later in a similar way (or as a
nested remote_refs list.)
2024-05-10 08:36:38 +09:00
Yuya Nishihara
9a5b001d58 templater: add SizeHint type to represent revset.count_estimate() value
We'll probably add binary comparison operators at some point, but this patch
also adds size_hint.zero() method. Otherwise, we'll have to write
"if(x.upper() && x.upper() == 0, ..)" to deal with None.

The resulting "branch list" template will look like:
```
separate(", ",
  if(!ref.tracking_ahead_count().zero(),
    if(ref.tracking_ahead_count().exact(),
      "ahead by " ++ ref.tracking_ahead_count().exact() ++ " commits",
      "ahead by at least " ++ ref.tracking_ahead_count().lower() ++ " commits")),
  if(!ref.tracking_behind_count().zero(),
    if(ref.tracking_behind_count().exact(),
      "behind by " ++ ref.tracking_behind_count().exact() ++ " commits",
      "behind by at least " ++ ref.tracking_behind_count().lower() ++ " commits")),
)
```
2024-05-09 08:51:34 +09:00
Ilya Grigoriev
9be159342c config.md: advertise diffedit3 as an alternative to meld-3 diff editor
This is instead of https://github.com/martinvonz/jj/pull/3292, which would make
`diffedit3` built into `jj`. I still have some hope of eventually making
`diffedit3` into the default diff editor that is available without any
configuration, which probably requires building it into `jj`, but this may not
happen, and it wouldn't hurt to test `diffedit3` first. Some examples of
concerns (see also the discussion in that PR):

- It is only a guess on my part that this would make a good default. The editor
might not be polished enough, and most users are not used to 3-pane diff
editing. I think most users would like it if they tried it, but this might be
plain wrong.

- There are concerns about adding a heavyweight dependency on `jj`. While I
tried to make it as lightweight as possible, it still unavoidably includes a web
server.

- There may be ways to bundle `diffedit3` with `jj` without combining them in a
single binary.
2024-05-08 11:38:41 -07:00
Ilya Grigoriev
638649b435 tutorial: edits to the diff editor explanation
Follows up on #3599. I also moved the discussion of other diff editors to a
footnote, as it didn't seem to fit well into the flow of the text.
2024-05-05 18:17:38 -07:00
Eidolon
3d898d0a06 Add default value of revsets.log to config docs
I wanted to have a reference point for the built-in revsets,
but `jj config get revsets.log` doesn't turn anything up since
it has special handling for the legacy config key
`ui.default-revset`. So I had to dig into the source code of jj
to get it.

I think it might help others to be able to reason about revsets
to have the log default shown in the settings documentation.
2024-05-05 07:17:32 -07:00
Yuya Nishihara
4db068e7f7 templater: expose RefTarget methods through RefName type
I considered adding RefTarget template type, but some of the methods naturally
fit to RefName. For example, a conflicted branch name is decorated as "??", so
it makes sense to add branch.conflict() instead of branch.target().conflict().

I'm not pretty sure how many RefName methods we'll need to add to port the
current branch listing, but there will be .tracked(), .tracking_local_present(),
.ahead_by(), and .behind_by().
2024-05-03 15:16:52 +09:00
Charles Crete
d9d60118a3 docs: update tutorial to include :builtin diff editor instructions 2024-05-02 23:04:40 -04:00
Jonathan Lorimer
e54e83b0f5 docs: Add information about configuring delta pager
docs: Add information about configuring delta pager

docs: only mention pager, not diff
2024-04-29 10:22:05 -07:00
Charles Crete
c8123e1555 docs: mention obslog in tutorial 2024-04-29 08:40:05 -07:00
Noah Mayr
dc693e7b8f template: add contained_in method to commit object in templates
this allows to conditionally display or label elements depending on 
whether the given commit is contained within the revset
2024-04-29 12:16:42 +02:00
Benjamin Tan
f75461efc1 rebase: add --insert-after and --insert-before options for --revisions 2024-04-29 14:19:09 +08:00
Théo Daron
2f45a482a6 fixed usage of old "checkout" command in contributing docs 2024-04-25 09:11:52 -07:00
Yuya Nishihara
5b769c5c9e fileset, revset, templater: add support for single-quoted raw string literals
Since fileset/revset/template expressions are specified as command-line
arguments, it's sometimes convenient to use single quotes instead of double
quotes. Various scripting languages parse single-quoted strings in various ways,
but I choose the TOML rule because it's simple and practically useful. TOML is
our config language, so copying the TOML syntax would be less surprising than
borrowing it from another language.

https://github.com/toml-lang/toml/issues/188
2024-04-25 11:14:33 +09:00
Martin von Zweigbergk
3dad9d4a98 docs: make "Arch Linux" a subheading under "Linux"
I think this is how it was supposed to be. The "From Source" section
applies to non-Arch Linuxes too.
2024-04-24 09:22:51 -07:00
Rowan Walsh
16ffe9408c Fixes grammar issues in docs 2024-04-24 09:12:37 -07:00
Rowan Walsh
1490c0a196 Fixes typo in docs 2024-04-24 09:12:37 -07:00
Yuya Nishihara
528ccb318e fileset: fall back to bare pattern/string if no operator-like character found
While I like strict parsing, it's not uncommon that we have to deal with file
names containing spaces, and doubly-quoted strings such as '"Foo Bar"' look
ugly. So, this patch adds an exception that accepts top-level bare strings.
This parsing rule is specific to command arguments, and won't be enabled when
loading fileset aliases.
2024-04-24 12:02:07 +09:00
Ilya Grigoriev
77eaf67f96 revsets.md: document the all: prefix modifier for revsets
While this is arguably not part of the revset language, this
is a likely place for a user to look.

See https://discord.com/channels/968932220549103686/968932220549103689/1228065431281995837
2024-04-20 14:12:26 -07:00
Austin Seipp
493020c0a6 docs: add an entry for snapshot.max-new-file-size
This was not documented, for some reason.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: I01a86a2d62b225c0175ed690fe9966ed22c92745
2024-04-19 13:03:24 -05:00
Philip Metzger
3ac61a4984 docs: Replace some mentions of jj co with jj new.
Also move some sentences away from "check out" to "create a new revision ...",
even if it isn't the phrasing we want.

Fixes #3487
2024-04-19 18:03:22 +02:00
Yuya Nishihara
4474577ceb fileset: parse cwd/root-glob patterns
Mercurial appears to resolve cwd-relative path first, so "glob:*.c" could be
parsed as "**/*.c" if cwd was literally "**". It wouldn't practically matter,
but isn't correct. Instead, jj's parser first splits glob into literal part
and pattern. That's mainly because we want to parse the user input texts into
type-safe objects, and (RepoPathBuf, glob::Pattern) pairs are the simplest
ones. The current parser can't handle patterns like "foo/*/.." (= "foo" ?),
and errors out. I believe this restriction is acceptable.

Unlike literal paths, the 'glob:' pattern anchors to the whole file path. I
don't think "prefix"-matching glob is useful, and making it the default would
be rather confusing.
2024-04-18 11:09:54 +09:00
Martin von Zweigbergk
0525dc9d86 politics: delete references to Pijul
The Pijul maintainer has opinions that I don't understand about how we
mention Pijul (they consider the current mentions offensive as
"bashing Pijul"). Let's just remove the references so we don't have to
deal with it. I think the references to Darcs we already had in most
of these places are sufficient.
2024-04-14 13:16:08 -07:00
Yuya Nishihara
30984dae4a cli: if enabled, parse path arguments as fileset expressions
If this doesn't work out, maybe we can try one of these:
 a. fall back to bare file name if expression doesn't contain any operator-like
    characters (e.g. "f(x" is an error, but "f x" can be parsed as bare string)
 b. introduce command-line flag to opt in (e.g. -e FILESET)
 c. introduce pattern prefix to opt in (e.g. set:FILESET)

Closes #3239, #2915, #2286
2024-04-12 11:36:40 +09:00
Yuya Nishihara
a9694cba27 cli: add ui.allow-filesets to experiment with fileset/pattern syntax
The pattern syntax could be enabled unconditionally, but I want to fully
replace the ad-hoc pattern parsing function.
2024-04-12 11:36:40 +09:00
Ilya Grigoriev
8fa256ebac New jj debug watchman status command
This command checks not only whether Watchman works, but also whether
it's enabled in the config. Also, the output is easier to understand
than that of the other `jj debug watchman` commands.

It would be nice if `jj debug watchman` called `jj debug watchman
status`, but it's not trivial in `clap` to have a default subcommand.
2024-04-11 10:55:59 -07:00
Ilya Grigoriev
383711fcd8 config docs: document valid fsmonitor values
I was wondering how to disable the watchman in a repo if it's enabled in
the user config.
2024-04-11 10:55:59 -07:00
Yuya Nishihara
653173abad fileset: implement name resolution stage, add all()/none() functions
#3239
2024-04-09 20:42:09 +09:00
Anton Bulakh
29729e844d templater: Add operation.snapshot() boolean
Expose the information we now record, to allow changing the default "snapshot
working copy" message or to make snapshots more compact/less distracting in
the log
2024-04-07 19:46:52 +03:00
Yuya Nishihara
8b32a8a916 revset: add support for file(kind:pattern) syntax
There are no more callers of parse_function_argument_to_string(), so it's
removed. This function was a thin wrapper of literal parser, and can be
easily reintroduced if needed.
2024-04-07 19:43:29 +09:00
Yuya Nishihara
850887cf09 fileset: add basic pattern parsing functions
Naming convention is described in FilePattern::from_str_kind(). It's based
on Mercurial's pattern prefixes, but hopefully fixes some inconsistencies.
https://github.com/martinvonz/jj/issues/2915#issuecomment-1956401114

#3239
2024-04-07 19:43:29 +09:00
Austin Seipp
db14f33170 cli: add ui.always-allow-large-revsets option
This lets users use "large" revsets in commands such as `jj rebase`, without
needing the `all:` modifier.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: Ica80927324f3d634413d3cc79fbc73057ccefd8a
2024-04-04 18:38:48 -05:00
Noah Mayr
2cf1c34f58 template: add method mine() to commit type 2024-04-04 22:47:34 +02:00
Martin von Zweigbergk
361b4ca425 docs: use command with argument as example for ui.default-command
Makes it easier to figure out how to pass arguments.
2024-04-04 11:19:07 -07:00
Noah Mayr
88a4a8281f cli: add better error message when immutable_heads() cannot be resolved 2024-04-03 07:58:00 +02:00
Noah Mayr
b79984884d cli: only use default log revset when neither path nor revset is provided 2024-04-03 07:57:06 +02:00
Patric Stout
e5b9e8ff58 docs: "bash" is no longer optional for command-line completion 2024-04-02 09:30:44 -07:00
Christoph Koehler
7bde6ddc29 revset: add working_copies() function
It includes the working copy commit of every workspace of the repo.

Implements #3384
2024-04-01 19:36:53 -06:00
Yuya Nishihara
a2a9b7decb templater: add coalesce() function that selects first non-empty content
This can be used to flatten nested "if()"s. It's not exactly the same as "case"
or "switch" expression, but works reasonably well in template. It's not uncommon
to show placeholder text in place of an empty content, and a nullish value
(e.g. empty string, list, option) is usually rendered as an empty text.
2024-03-28 10:51:47 +09:00
Yuya Nishihara
b363e695e4 commit_templater: make git_head return Option<RefName> instead of Vec<_>
Since we've introduced Option type, it no longer makes sense that git_head
returns a Vec<RefName>.
2024-03-26 00:28:43 +09:00
Yuya Nishihara
96e0bc0bdd templater: turn logical && and || into short-circuiting operators
Since the context (or self) property is no longer passed by argument, it's easy
to implement short-circuiting behavior.
2024-03-25 11:15:18 +09:00
Yuya Nishihara
c311131ee2 log: encode elided node as None
Since elided graph entry has no associated commits, it makes some sense to
represent as None?
2024-03-24 10:32:15 +09:00
Yuya Nishihara
2fc7febaef commit_templater: teach elidable (or optional) commit
I think Option<Commit> is the simplest encoding of the log node.

The behavior of an Option type is closer to nullable types rather than the
Option in Rust. I don't think we would want to write opt.map(|x| x.f()) or
opt.unwrap().f(). We can of course add opt?.f() syntax, but it will be a short
for "if(opt, opt.f())"?
2024-03-24 10:32:15 +09:00
Anton Älgmyr
e2eb5bddf9 Make node symbols templatable in the graphs.
Adds config options
* templates.log_graph_node
* templates.log_graph_node_elided
* templates.op_log_graph_node
2024-03-21 17:41:31 +01:00
Martin von Zweigbergk
e51878f4fd cli: show timestamp in local timezone and without millis and offset
As discussed in #2900, the milliseconds are rarely useful, and it can
be confusing with different timezones because it makes harder to
compare timestamps.

I added an environment variable to control the timestamp in a
cross-platform way. I didn't document because it exists only for tests
(like `JJ_RANDOMNESS_SEED`).

Closes #2900
2024-03-20 07:54:08 -07:00
Matthew Davidson
e4053ead64 docs: Add missing "jj" to swap rebase example
`jj rebase -r C -d A; rebase -s B -d C` is missing the second jj.

Although it would be cool if jj had syntax to chain commands like this, so I could write a "swap" alias.
2024-03-19 05:58:52 -07:00
Tom Ward
933150d819 cli: allow colors in form #rrggbb
Changes the formatter to accept not only existing color names (such as "red" or
"green") but also those in the form #rrggbb, where rr, gg, and bb are two-digit
hexadecimal numbers. This allows much finer control over colors used.
2024-03-18 08:03:31 +00:00
Alexis (Poliorcetics) Bourget
f9f740b263 docs: mention the signing key can be a file path too 2024-03-15 20:34:08 +01:00
Khionu Sybiern
3bbc3e5715 docs: add FAQ for why to use new-then-amend over edit 2024-03-14 11:32:53 -07:00
Yuya Nishihara
218b1c6c16 commit_templater: add self.immutable() method
I don't know how immutable revisions should be labeled by default, but users
can customize templates whatever they like.
2024-03-14 22:59:43 +09:00
TrashCan
33911712a2 Add archlinux instructions to install-and-setup.md
based upon #3289 by @roland-5
2024-03-13 21:35:08 -07:00
mrstanwell
4d71ef1518 docs: Fix FAQ reference to glossary entry for co-located repos
In the FAQ question "How do I integrate Jujutsu with Gerrit?", the link
to the glossary entry for "co-located repos" was pointing to the entry
for "change-id".
2024-03-13 14:14:12 -07:00
Martin von Zweigbergk
e9655dba13 move: deprecate the command
Per discussion in
https://github.com/martinvonz/jj/discussions/2882. `jj squash` now has
all the functionality.
2024-03-11 09:25:17 -07:00
Martin von Zweigbergk
6d78d92d91 cli: move jj amend/unamend aliases to config
The `amend/unamend` aliases exist for smoothen onboarding for
Git/Mercurial users; I don't think we should recommend that users use
them, so I think it's fine if users override them as they
like. Therefore, I think they belong in the config.
2024-03-09 22:43:50 -08:00
Martin von Zweigbergk
2df977b221 docs: say that we support $GIT_DIR/info/exclude
We have had support for `GIT_DIR/info/exclude` since 8336c48 (almost
exactly two years ago).
2024-03-08 09:59:10 -08:00
Thomas Castiglione
d661f59f9d working_copy: implement symlinks on windows with a helper function
enables symlink tests on windows, ignoring failures due to disabled developer mode,
and updates windows.md
2024-03-05 15:16:38 +08:00
Austin Seipp
415ae5c0f9 docs: make it clear ui. refers to a toml section
There was a question on Discord about why using Difftastic wasn't working as the
diff tool. The root cause was putting `ui.diff.tool` in the wrong toml section,
when the `ui.` component actually refers to the `[ui]` section itself.

This reads kind of weirdly too because _immediately_ after this, the alternative
option of using the `merge-tools` section is suggested; except it uses `[merge-
tools.<name>]` which makes it immediately clear it's a section on its own.

This simply these two examples more consistent with each other, by using `[ui]`
instead of `ui.` to make it clear `ui.` is a top-level section.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-03-03 11:25:03 -06:00
Yuya Nishihara
78edb615a2 docs: update revset alias example to something very different from builtins
We've added mine() function, so this alias looks confusing.
2024-03-03 21:35:41 +09:00
Benjamin Tan
f135e09951 Docs: Add note about jj edit to Git comparison 2024-03-03 16:23:28 +08:00
Philip Metzger
494eba82b5 docs: Add a short section on branch movement.
This is something which should've been written down long ago. This is a follow-up upon 
another question from Julia Evans in Discord. 

Thank you again for asking such good questions.
2024-03-02 15:51:58 +01:00
Yuya Nishihara
82b3017fda templater: add string.len() and list.len() methods 2024-03-01 08:51:20 +09:00
Yuya Nishihara
0656409904 templater: make .substr() be byte-index based, round towards origin
I'm going to add string.len() method which will return a length in bytes. The
number of the UTF-8 code points is useless metrics, and strings here are often
ASCII bytes, so let's simply use byte indices in substr().

If the given index is not at a char boundary, it will be rounded. I considered
making it an error, but that would be annoying. I would want to see something
printed by author.name().substr() even if it contained latin characters.

I've extracted index normalization function which might be used by other string
methods. The remaining part of substr() is trivial, so inlined it.
2024-03-01 08:51:20 +09:00
Yuya Nishihara
7e127f500a docs: update remaining references on "jj init --git-repo" 2024-02-28 09:03:16 +09:00
Yuya Nishihara
8d0414549b cli: unblock "jj git init --colocate" in existing Git repo directory
I'm not sure what's the conclusion in #2747, but I don't think there is a
disagreement on allowing --colocate to import existing Git repo.
2024-02-28 09:03:16 +09:00
Stephen Jennings
6e29abb180 docs: add guidance for handling CRLF on Windows 2024-02-26 10:06:06 -08:00
Paulo Coelho
e9243a7638 cli branch list: list tracked branches
Add an option to list tracked branches only

This option keeps most of the current `--all` printing logic, but:

- Omits local Git-tracking branches by default (can be extended to
  support filtering by remote).
- Skip over the branch altogether if it doesn't contain tracked remotes
- Don't print the untracked_remote_refs at the end

Usage:

`jj branch list -t`
`jj branch list --tracked`
`jj branch list --tracked <branch name>`
2024-02-26 01:05:07 +00:00
Philip Metzger
5b0ef324d1 docs: Add a Testmonials page.
Show our positive reviews to the world. It's also not completly serious, in a similar fashion to
Phabricator.

Co-Authored-By: Austin Seipp <aseipp@pobox.com>
2024-02-25 14:20:33 +01:00
Yuya Nishihara
7525fac12a templater: add special "self" variable to refer to top-level object
This allows us to call alias function with the top-level object.

For convenience, all self.<method>()s are available as keywords. I don't think
we'll want to deprecate them. It would be tedious if we had to specify
-T'self.commit_id()' instead of -Tcommit_id.
2024-02-25 09:01:04 +09:00
Yuya Nishihara
ff37b07d90 docs: move template keywords list to corresponding types
I'm going to introduce the "self" variable, and it will make more sense to
document keywords as methods of the self object type.
2024-02-25 09:01:04 +09:00
Yuya Nishihara
e9b420f592 templater: add Operation type and methods
There are no keywords or methods that return Operation yet, but we might add
"self" keyword that returns the context object.
2024-02-23 10:13:25 +09:00
Julien Vincent
84685a4d71 sign: Update documentation 2024-02-20 00:02:08 +00:00
Alexis (Poliorcetics) Bourget
c75230747a completion: Add support for Nushell completions 2024-02-18 19:08:38 +01:00
Alexis (Poliorcetics) Bourget
fb10e3f296 completion: Update docs for new style with positional argument 2024-02-17 19:26:30 +01:00
Yuya Nishihara
815437598f revset: disable parsing rules of legacy dag range operator
The legacy parsing rules are turned into compatibility errors. The x:y rule
is temporarily enabled when parsing string patterns. It's weird, but we can't
isolate the parsing function because a string pattern may be defined in an
alias.
2024-02-14 10:04:56 +09:00
Martin von Zweigbergk
6ad49d232e cli: drop support for legacy graph style
I don't think anyone uses the legacy graph style. It's very similar to
the "ascii" style from Sapling's `renderdag` crate.
2024-02-12 17:33:55 -08:00
Benjamin Brittain
d3699c2327 Use minus as a builtin pager 2024-02-12 18:55:15 -05:00
Ilya Grigoriev
16ec185795 docs, CLI reference: use include-markdown instead of a symlink
The main goal is to avoid having a symlink in our source tree. Currently, there
is no good way to work with the `jj` repo with `jj` on Windows.  Currently `jj`
just crashes with symlinks. This is being worked on, see e.g. #2939, but it will
always depend on whether Developer Mode is enabled in Windows or whether
symlinks are materialized as text files with symlinks. Finally, MkDocs has
trouble following symlinks on Windows, so building docs wouldn't work there.

Another advantage is that, previously, we were lucky that MkDocs treats `insta`
header in `cli-reference@.md.snap` as a Markdown header and follows symlinks at
all. Now, we no longer depend on that.
2024-02-12 10:28:09 -08:00
Martin von Zweigbergk
7c5cfa7cc7 templater: add a local() method on Timestamps (#2900) 2024-02-12 10:22:24 -08:00
jyn
bca905a26e document the jj equivalent of git reset --soft
i did the following things:

1. make some changes to the working copy
2. run `jj commit`
3. before i added a description, i decided i didn't want to commit yet. in git, the way to do this is to delete the contents of the editor; git sees that it is blank and aborts the commit. in jj, this doesn't work, because descriptions are allowed to be empty.

now i have the following jj state:
```
; jj log --stat
@  pokrsyvs github@jyn.dev 2024-02-06 21:48:17.000 -05:00 ddd6217f
│  (empty) (no description set)
│  0 files changed, 0 insertions(+), 0 deletions(-)
◉  lqqmzmku github@jyn.dev 2024-02-06 21:48:02.000 -05:00 HEAD@git b03bf3de
│  (no description set)
│  config/jj.toml | 2 +-
│  1 file changed, 1 insertion(+), 1 deletion(-)
◉  xqkmwvwp github@jyn.dev 2024-02-06 21:47:08.000 -05:00 master b673f97b
```
i want to undo the most recent commit, `lqqmzmku`. i'm used to doing this with `git reset --soft HEAD~`, which makes the parent `xqkmwvwp` and leaves the change to `config/jj.toml` on disk while removing it from the git history; basically `lqqmzmku` would go back to being the working copy.

i found that `jj move` does what i want, but it took a lot of trawling the options, it wasn't obvious, and i couldn't find `git reset` mentioned in the docs.
2024-02-10 08:49:03 -08:00
Yuya Nishihara
e943a5b092 templater: parse negative integer as unary operator and literal
Follows up 9702a425e5 "Allow negative numbers in the template grammar."
Since we've added parsing rules for operator expressions, it makes sense to
parse unary '-' as operator.
2024-02-10 09:15:21 +09:00
Austin Seipp
5b517b542e rust: bump MSRV to 1.76.0
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-02-09 15:48:01 -06:00
Austin Seipp
c8f703f14b docs: fix some automerge fallout
I enabled automerge for #2994, but forgot to actually *push* my changes
before resolving all the conversations, so GitHub insta-merged it.

This just addresses Ilya and Philip's final comments on #2994.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-02-09 12:36:28 -06:00
Austin Seipp
015c52bcdc docs: document git.fetch and git.push config options
Someone on Discord asked this exact question, but these options apparently
weren't documented when they were added in the `0.7.0` release.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-02-09 12:03:42 -06:00
Yuya Nishihara
948129e88f templater: evaluate logical operator expressions (||, &&, and !)
#2924
2024-02-09 07:42:54 +09:00
Martin von Zweigbergk
1be8225046 docs: explain that approving your coworker's PRs should be avoided
We want to avoid conflicts of interest (both real and
apparent). Better to document this before it happens.

By the way, Ilya and I both work for Google and we have approved lots
of each others' PRs, but we work in very different parts of the
company and I don't think any of the PRs have been specific to
Google's interests.
2024-02-06 21:34:58 -08:00
Chris Krycho
fc3283817d docs: Add FAQ item for git log
New users often want to know how to just see what `git log` would show.
Putting it in the FAQ isn’t perfect but might help a bit.
2024-02-06 15:03:51 -07:00
Yuya Nishihara
026a72dfe7 templater: add surround(prefix, suffix, content) function
I'll probably add infix logical operators later, but the surround() function
is still useful because we don't have to repeat the condition:

    if(x || y, "<" ++ separate(" ", x, y) ++ ">")
    surround("<", ">", separate(" ", x, y))

It can't be used if we want to add placeholder text, though:

    if(x || y, "<" ++ separate(" ", x, y) ++ ">", "(none)")

Closes #2924
2024-02-06 23:39:34 +09:00
Ilya Grigoriev
5dd938bc49 config.md: link to and mention the name of "scm-diff-editor" 2024-02-05 20:04:51 -08:00
Michael Pratt
f877dfbead docs: add co-located repo hint to Gerrit question
Working with Gerrit requires directly invoking git commands, which is awkward
without a co-located repo. Add a hint to use a co-located repo.
2024-02-05 22:39:54 +01:00
Ilya Grigoriev
0773cefe32 FAQ: Fix typo in and edit one of the entries 2024-02-04 13:32:11 -08:00
Austin Seipp
3f13ea39e2 cli: deprecate jj checkout
Summary: As discussed in Discord, on GitHub, and elsewhere, this change
deprecates the use of `jj checkout` and suggests users use `jj new` exclusively
instead. The verb `checkout` is a relic of a bygone era the — days of RCS
file locking, before 3-way merge — and is not a good, fitting name for the
functionality it provides.

To further drive the bit home, by default, `jj checkout` (and `jj co`) is now
hidden. This will hopefully stop new users from running into it.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: I7a1adfc9168fce1f25cf5d4c4c313304769e41a1
2024-02-03 17:21:56 -06:00
Ilya Grigoriev
b3c47953e8 config.md docs: document jj config edit and jj config path
This changes the intro section to recommend using `jj config edit` to
edit the config instead of looking for the files manually.
2024-02-02 23:29:58 -08:00