Commit graph

137 commits

Author SHA1 Message Date
Isabella Basso
3dfedf5814 docs/config.md: add example for using pipes
As discussed on issue #1273, pipe usage on the jj config differs from
git and hg.

Signed-off-by: Isabella Basso <isabbasso@riseup.net>
2023-02-17 08:35:35 -08:00
Ilya Grigoriev
e7bd7a635a config.md: Add a link to TOML syntax guide 2023-02-16 09:56:57 -08:00
Ilya Grigoriev
6cc7aa72e8 config.md: expand on equivalence of headers and dotted keys
Now that we use headers to define `[template-aliases]`, I thought we should explain how they are also equivalent to dotted keys.

Alternatively, we could rewrite them all in the dotted style, but it would look awkward.
2023-02-16 09:56:57 -08:00
Ilya Grigoriev
e4aa2cb2e5 Rename ui.relative-timestamps to ui.oplog-relative-timestamps 2023-02-15 21:26:14 -08:00
Yuya Nishihara
ffa690abec docs: document default template aliases instead of config knobs
I'm going to remove the corresponding config knobs.

As an example of "brackets" short id, I put a simplified version. It's
unlikely that the "rest()" gets empty for hashes of 12-char long.
2023-02-16 11:43:17 +09:00
Martin von Zweigbergk
a67fbb6714 cli: switch default graph style to be Sapling's curved style
We seem to quite unanimously prefer this style, so let's make the
default.
2023-02-12 07:23:29 -08:00
Vamsi Avula
98261e81e2 Fix typos and slightly simplify code from #1235 2023-02-12 03:17:40 +05:30
Vamsi Avula
daf7b656e3 config: add and parse ui.log_author_format for use in the default template
Supported values are,

- `none` for no author information,
- `full` for both the name and email,
- `name` for just the name,
- `username` for username part of the email,
- (default) `email` (or any other gibberish for that matter) for the full email.
2023-02-11 20:54:23 +05:30
Yuya Nishihara
ba1c4f5fe5 cli: replace all $variable matches found in edit/merge-args 2023-02-07 18:32:57 +09:00
Yuya Nishihara
a1bfe33a08 cli: expand $left/$right parameters in merge-tools.<name>.edit-args
And set edit_args = ["$left", "$right"] by default.
2023-02-07 18:32:57 +09:00
Martin von Zweigbergk
9cdc202b39 cli: document diff format 2023-02-05 23:36:30 -08:00
Ilya Grigoriev
5fb17925eb jj log: option to specify preferred id length
The new option is `ui.log-id-preferred-length`. Setting it to 6
is quite convenient for the `jj` repo, for example.

Screenshot: https://user-images.githubusercontent.com/4123047/216535699-ad1e2ac8-73dd-44be-b28a-ebdebc00c63c.png
2023-02-05 21:18:42 -08:00
Yuya Nishihara
13d9dc4460 cli: allow to set ui.diff/merge-editor arguments inline
For stock merge-tools, having name -> args indirection makes sense. For
user-specific settings, it's simpler to set command name and arguments
together.

It might be a bit odd that "name with whitespace" can be parsed differently
depending on the existence of merge-tools."name with whitespace".
2023-02-06 11:28:40 +09:00
Martin von Zweigbergk
18d4300895 formatter: rename underlined color config to underline
I keep calling it `underline` by mistake, so that probably means that
it's a more natural name for it. We haven't made a release of it yet,
so I didn't mention it in the changelog.

I didn't update all variables to also use `underline`, because I felt
that `underlined` was usually more natural there, plus crossterm calls
it `Attribute::Underlined`.
2023-01-31 08:14:27 -08:00
Ilya Grigoriev
6e05c5a829 jj log: Change the default of ui.unique-prefixes to "styled" 2023-01-30 22:48:38 -08:00
Glen Choo
3418c8ff73 git: add git.auto-local-branch
Add a new git.auto-local-branch config option. When set to false, a
remote-tracking branch imported from Git will not automatically create a
local branch target. This is implemented by a new GitSettings struct
that passes Git-related settings from UserSettings.

This behavior is particularly useful in a co-located jj and Git repo,
because a Git remote might have branches that are not of everyday
interest to the user, so it does not make sense to export them as local
branches in Git. E.g. https://github.com/gitster/git, the maintainer's
fork of Git, has 379 branches, most of which are topic branches kept
around for historical reasons, and Git developers wouldn't be expected
to have local branches for each remote-tracking branch.
2023-01-29 20:17:49 -08:00
Samuel Tardieu
a7aed0171d style: fix typos found by codespell 2023-01-28 07:23:45 -08:00
Martin von Zweigbergk
9ac4fdb11c docs: describe color configuration 2023-01-27 13:16:26 -08:00
Martin von Zweigbergk
d8942d5f96 cli: rename ui.graph.format to ui.graph.style
I think of it more as style than a format, so using `style` in the
config key makes sense to me.

I didn't bother making upgrades easy by supporting the old name since
this was just released and only a few developers probably have it set.
2023-01-27 10:36:26 -08:00
Martin von Zweigbergk
0b99e5b16e graphlog: enable Sapling's graph styles by default
I would also rename the feature, but I hope we can instead soon make
it a non-optional dependency and delete the feature.
2023-01-27 09:46:57 -08:00
Yuya Nishihara
a7d02e66de docs: use fenced code blocks and enable syntax highlighting of toml snippets 2023-01-27 13:53:20 +09:00
Martin von Zweigbergk
772d6c47dd docs: document configuration of aliases 2023-01-26 18:15:23 -08:00
Martin von Zweigbergk
d4ed8f32b3 docs: format config.md 2023-01-26 18:15:23 -08:00
Martin von Zweigbergk
780e257b89 docs: fix a typo in config.md and add a missing comma 2023-01-26 18:15:23 -08:00
Ilya Grigoriev
e7c434d492 Make ui.unique-prefixes default to brackets 2023-01-17 22:01:09 -08:00
Ilya Grigoriev
67b81a77b8 Config: ui.unique-prefixes to show id shortest unique prefixes
Currently, the possible values are `underscore` and `none`. For now, `none`
is the default, since the `underscore` value messes up copy and pasting of
ids. In the future, an `underline` value should be implemented and will
likely become the default.

Screenshot of `underscore`: https://user-images.githubusercontent.com/4123047/212502483-4119fb17-0601-4335-9770-196e36a6bc31.png
2023-01-17 22:01:09 -08:00
Yuya Nishihara
ea96ea3ffe cli: load configs from .jj/repo/config.toml
Since per-repo config may contain CLI settings, it must be visible to CLI.
Therefore, UserSettings::with_repo() -> RepoSettings isn't used, and its
implementation is nullified by this commit.

#616
2023-01-07 11:33:12 +09:00
Ilya Grigoriev
8f9cc3f4e8 Instructions and better config for Vim as a diff editor
After I changed `merge-tools.vimdiff.program` to `vim`, using
`vimdiff` as a diff editor wouldn't work at all. 

Out of the box, it's still not a good experience. I included a
recommendation of a plugin to install to make it better.
2022-12-17 22:08:50 -08:00
Martin von Zweigbergk
c5c89b9e9b pager: default to less -FRX
As dbarnett@ reported on #9, our default of `less`, combined with our
default of enabling color on TTYs, means that we print ANSI codes to
`less` by default. Unless the user has set e.g. `$LESS=R`, `less` is
going to escape those codes, resulting in garbage like this:

```
@ ESC[1;35mbb39c26a29feESC[0m ESC[1;33m(no email configured)ESC[0m ESC[1;36m2022-12-03....
```

I guess most of us didn't notice because we have something like
`$LESS=FRX` set.

This patch changes our default from `less` to `less -FRX`. Those are
the flags we're using for our internal hg distribution at Google, and
that has seemed quite uncontroversial.

I added a pointer from the changelog to the tracking issue while at
it.
2022-12-04 00:00:31 -08:00
Ilya Grigoriev
8222ba94cf Documentation for jj resolve and merge tool config 2022-12-03 15:12:40 -08:00
Yuya Nishihara
de639c3ef1 cli: accept command arguments specified by array
It should be more reliable than parsing a command string into array.

Also updated some of the doc example to use array syntax. I don't think
"C:/Program Files" was parsed properly, but might work thanks to Windows
magic.
2022-12-02 15:44:10 +09:00
Ilya Grigoriev
52fadc046e Miscellaneous improvements to config docs
Also moves the "relative timestamps" section to make merge tool
docs fit in better.
2022-11-29 20:55:11 -08:00
Benjamin Saunders
ce0aa95162 docs: clarify diff editor interface 2022-11-29 17:58:02 -08:00
Glen Choo
7c2400f3e5 ui: add pager
Teach Ui's writing functions to write to a pager without touching the
process's file descriptors. This is done by introducing UiOutput::Paged,
which spawns a pager that Ui's functions can write to.

The pager program can be chosen via `ui.pager`. (defaults to Defaults to
$PAGER, and 'less' if that is unset (falling back to 'less' also makes
the tests pass).

Currently, commands are paginated if:

- they have "long" output (as defined by jj developers)
- jj is invoked in a terminal

The next commit will allow pagination to be turned off via a CLI option.
More complex pagination toggling (e.g. showing a pager even if the
output doesn't look like a terminal, using a pager for shorter ouput) is
left for a future PR.
2022-11-30 06:14:39 +08:00
Ruben Slabbert
01817e4321 feature: support relative timestamps as a config option 2022-11-27 08:35:17 +10:00
Ilya Grigoriev
93b7b34871 Add --config-toml command-line argument for additional TOML config
Unfortunately, TOML requires quotes around the argument. So, the
usage is `jj --config-toml ui.color=\"always\"` in bash. The plan is
to eventually have a `--config` option with simpler syntax for
simple cases.

As discussed in https://github.com/martinvonz/jj/discussions/688.
2022-11-05 21:21:33 -07:00
iain barnett
573320ba7d Documented available config settings.
docs: Added config settings to documentation.
2022-07-16 21:28:40 -07:00