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

10 commits

Author SHA1 Message Date
Yuya Nishihara
6bbf4c6fcf tests: extract log template function/variable for code readability
Also rewrites some lengthy templates. That's why the test output slightly
changed.
2023-03-01 16:39:23 +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
Yuya Nishihara
e63ea86841 templater: do not complete "(no commit description)" by default
This allows us to use "if(description,)" to test empty description. And
I think this change is unavoidable if we want to add support for commit
template.
2023-02-01 16:13:43 +09:00
Yuya Nishihara
2550dcae4c cli: include diff summary in commit/describe editor content 2022-12-23 00:47:22 +09:00
Yuya Nishihara
5076622598 tests: use insta to test editor contents
It's tedious to update editor expectation manually. Let's dump the actual
content and test it after each command invocation.
2022-12-23 00:47:22 +09:00
Yuya Nishihara
300f744e41 cli: normalize line ending of edited commit description, ensure last newline
Since CR+LF vs LF things shouldn't matter in commit description, it's probably
better to normalize newline characters.

In Mercurial, ui.edit() and changelog.stripdesc() handle line normalization,
and trailing newlines are stripped. In Git, cleanup_message() handles that,
and the last newline is added after stripping trailing newlines.
2022-12-22 14:59:03 +09:00
Yuya Nishihara
6f8fb09609 cli: append "\n" to commit description specified by -m/--message
Otherwise the description set by -m would differ from the one set by editor.
This fixes test_describe() which says "make no changes", but previously "\n"
would be added by the second "jj describe".

As you can see, almost all hashes change in CLI tests. This means in-flight
PRs will need to be rebased to update insta snapshots.

Description text could be normalized by CommitBuilder, but the caller would
have to normalize it beforehand to compare with the current description, so
we would need an explicit function anyway. Another idea is to add a newtype
that represents a normalized description, and make CommitBuilder require it.
Commit::description() will return &Description in place of &str to ensure
that commit.description() == raw_str wouldn't compile.

Git CLI provides --cleanup=<mode> option to switch normalization rules, but
I don't think we'll need such feature.
2022-12-22 14:59:03 +09:00
Martin von Zweigbergk
d8feed9be4 copyright: change from "Google LLC" to "The Jujutsu Authors"
Let's acknowledge everyone's contributions by replacing "Google LLC"
in the copyright header by "The Jujutsu Authors". If I understand
correctly, it won't have any legal effect, but maybe it still helps
reduce concerns from contributors (though I haven't heard any
concerns).

Google employees can read about Google's policy at
go/releasing/contributions#copyright.
2022-11-28 06:05:45 -10:00
Ilya Grigoriev
0b528eb587 Fix some cargo +nightly clippy warnings 2022-11-24 20:29:17 -08:00
Martin von Zweigbergk
f02d92a3fe cli: add commit as its own command (not an alias for close)
It seems very likely that we're going to remove support for open
commits, but it's still useful to have a `commit` command that lets
the user enter a description and starts a new change. Calling it
`commit` seems good to make the transition from other VCSs simpler.
2022-11-05 06:14:37 -07:00