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

782 commits

Author SHA1 Message Date
Martin von Zweigbergk
5dce6e9884 working_copy: avoid using file_state() for getting mtime of tree_state file
I want to change the signature of `file_state()` and this caller is
different from the others and only needs the mtime.
2021-11-07 15:17:51 -08:00
Martin von Zweigbergk
efe7316354 working_copy: make FileType variants more similar to TreeValue variants
This change doesn't make much difference yet, but I think it will
enable further improvements.
2021-11-07 15:17:51 -08:00
Martin von Zweigbergk
bf61e9cf3e working_copy: don't stat ignored files 2021-11-07 15:17:51 -08:00
Martin von Zweigbergk
76c58b3949 tree_builder: rename repo() to more accurate store() 2021-11-07 15:17:51 -08:00
Martin von Zweigbergk
acf3798abc revsets: allow underscore in identifiers 2021-11-07 07:55:52 -08:00
Martin von Zweigbergk
0dac2e5ed5 docs: mention Breezy as a similar tool
Closes #40.
2021-11-04 08:32:42 -07:00
Martin von Zweigbergk
d37e484fc8 docs: explain what the tool is about, not why I started it 2021-10-28 15:01:19 -07:00
Martin von Zweigbergk
c293638028 docs: add more detail about the project status (like what's missing) 2021-10-28 15:01:19 -07:00
Martin von Zweigbergk
5c0e929b29 docs: add a "Related Work" section to README 2021-10-28 15:01:19 -07:00
Martin von Zweigbergk
60ea81882f cli: use same template for jj log --no-graph as for jj log
It is weird how the template changes because you ask for now
graph. Also, I've never wanted the long format. Let's just remove it.
2021-10-27 21:28:04 -07:00
Martin von Zweigbergk
853b40cf18 cleanup: run rustfmt on formatter (missed in recent commit) 2021-10-27 21:26:22 -07:00
Martin von Zweigbergk
98337e819d demos: add more jj log calls to the working-copy demo
Thanks to @arxanas for the suggestion.
2021-10-27 21:16:29 -07:00
Martin von Zweigbergk
4f8632519b docs: update demo links with recent changes 2021-10-27 18:12:21 -07:00
Martin von Zweigbergk
571336b827 demos: add some blank lines to separate groups of commands (and comments) 2021-10-27 16:55:59 -07:00
Martin von Zweigbergk
3981cd90f8 cli: use bright colors for head of operation log 2021-10-27 16:35:48 -07:00
Martin von Zweigbergk
922fea0c18 cli: use bright color for the current checkout's description too 2021-10-27 16:31:04 -07:00
Martin von Zweigbergk
18f450e530 cli: fix TODO about formatter label
Maybe something has changed since I added the TODO, but it seems the
problem it describes doesn't exist now.
2021-10-27 16:26:27 -07:00
Martin von Zweigbergk
3c6a922b97 docs: don't hide demos in collapsed regions in the README 2021-10-27 16:09:05 -07:00
Martin von Zweigbergk
04e54b093d demos: make comment lines shorter, to better fit on mobile 2021-10-27 16:09:01 -07:00
Martin von Zweigbergk
6687f98d8a cli and docs: replace "id" by more correct "ID" 2021-10-27 15:06:10 -07:00
Martin von Zweigbergk
3587d4ec7e cli: use bright colors for the current checkout
As @arxanas noted, it's hard to tell which commit is currently checked
out. Hopefully bright colors will help. Maybe setting a background
color would be even clearer, but that's harder to do because the
formatter doesn't support background colors yet.
2021-10-27 14:16:13 -07:00
Martin von Zweigbergk
b3ad965a3b formatter: delete default colors for obsolete, evolution-related labels 2021-10-27 14:13:01 -07:00
Martin von Zweigbergk
452fecb7c4 cli: colorize diff summary and sort by path
The order used to be like Mercurial's and the (lack of) coloring used
to be like Git's. Let's try the opposite :)
2021-10-27 14:13:01 -07:00
Martin von Zweigbergk
7917bad5b2 cli: rename "left"/"right" formatter labels to "removed"/"added" 2021-10-27 13:39:59 -07:00
Martin von Zweigbergk
c13b5ae50e cli: make jj branch --delete/--forget error out if branch doesn't exist 2021-10-26 06:12:17 -07:00
Martin von Zweigbergk
9abee0096f conflicts: propagate errors from materialize_conflict()
All current callers pass in a buffer, so it should never fail, but the
function itself can't know that.
2021-10-24 23:02:00 -07:00
Martin von Zweigbergk
191c1ee166 cli: make "added {} files, modified {} files, ..." message start with uppercase
We pretty consistently start with uppercase so this message stood out
and bothered me.
2021-10-24 12:46:01 -07:00
Martin von Zweigbergk
50058d8a31 cli: show help when jj git remote is called without subcommand 2021-10-23 20:55:18 -07:00
Martin von Zweigbergk
0f46c2453e revset graph: fix formatting I missed in recent commit 2021-10-23 20:53:41 -07:00
Martin von Zweigbergk
a3a13f8bbf demos: update demo recordings with stable graph edge ordering 2021-10-23 20:45:51 -07:00
Martin von Zweigbergk
b4a0e513dd revset graph: make order of edges stable
While working on demos, I noticed that `jj log` output in the
octocat/Hello-World repo was unstable: sometimes the first parent of
the merge was on the left and sometimes it was on the right. This
patch fixes that by sorting the edges by position in the index just
before returning them. It seems that most applications would want
stable output so I put it in the `RevsetGraphIterator` rather than
doing at the call site in the CLI. I ordered them with the reverse
index position rather than forward because it seemed to make the
graphs in the git.git repo slight nicer, with the left-most edge going
between subsequent releases.

There performance difference is within the noise level.
2021-10-23 20:33:59 -07:00
Martin von Zweigbergk
5acd360e86 demos: update conflict-resolution demo link to a lower-resolution version
I forgot to make my terminal window smaller before recording the
previous version.
2021-10-23 14:48:08 -07:00
Martin von Zweigbergk
c661181e08 demos: add demo of basic conflict resolution 2021-10-23 14:40:33 -07:00
Martin von Zweigbergk
78050b3d42 demos: add a --fast mode to speed up recording
It can take quite a while to record a demo. This patch adds a `--fast`
flag for reducing delays to a tenth of the usual. You can play the
recording with `asciinema play -s 0.1` to get close-to-normal speed
(except that command delays will be slower). That way you can adjust
timings with shorter round-trips.
2021-10-23 14:21:15 -07:00
Martin von Zweigbergk
2a5f0991fa demos: replace printf by regular shell variable expansion
This makes it clearer where each variable goes since they're not all
called "%s". I'm about to add more variables.
2021-10-23 09:32:18 -07:00
Martin von Zweigbergk
33bf6ce1d5 view: don't force commits pointed to by refs to be current heads
If you rewrite a commit that's also available on some remote, you'll
currently see both the old version and the new version in the view,
which means they're divergent. They're not logically divergent (the
rewritten version should replace the old version), so this is a UX
bug. I think it indicates that the set of current heads should be
redefined to be the *desired* heads. That's also what I had suspected
in the TODO removed by this change.  I think another indication that
we should hide the old heads even if they have e.g. a remote branch
pointing to them is that we don't want them to be rebased if we
rewrite an ancestor.

So that's what I decided to do: let the view's heads be the desired
heads. The user can still define revsets for showing non-current
commits pointed to by e.g. remote branches.
2021-10-23 09:15:05 -07:00
Martin von Zweigbergk
97612f9e99 demos: add demo of the operation log 2021-10-22 23:52:16 -07:00
Martin von Zweigbergk
74e21acd02 demos: add demo of automatic working copy commit 2021-10-22 21:59:07 -07:00
Martin von Zweigbergk
f72e53376f demos: set title when creating recording
According to asciinema.org, it should be possible to change the title
after uploading, but I couldn't figure out how to do that. Let's set
it when creating the recording. That also means it's one less step to
perform when re-running scripts.
2021-10-22 21:34:54 -07:00
Martin von Zweigbergk
2dd0bf7b12 demos: type faster, pause more
I find it frustrating to wait for the typing, but I need much more
time to think between commands (and users who are new to the tool
surely need even more time).
2021-10-22 18:36:00 -07:00
Martin von Zweigbergk
b1d473eafb demos: make run_command wait for the prompt
Most commands are non-interactive, so this reduces duplication. We can
add another function for running a command and not waiting for a
prompt when we need it.
2021-10-22 18:04:43 -07:00
Martin von Zweigbergk
234cb15ff8 demos: add automated demo of cloning Git repo
The automation is mostly copied from
https://github.com/arxanas/git-branchless/tree/master/demos, so big
thanks to @arxanas for writing that!
2021-10-22 13:56:30 -07:00
Martin von Zweigbergk
f35f2f0c97 docs: update tutorial with removed "at" from diff headers
I forgot to include this in the previous commit.
2021-10-22 13:05:04 -07:00
Martin von Zweigbergk
5098270640 cli: remove "at" from "Modified file at README" etc.
This patch changes the preposition depending on the case and removes
it in most cases.
2021-10-22 12:47:22 -07:00
Martin von Zweigbergk
709b2e85c2 cli: use finish_transaction() for remaining two commands too
I don't think it matters here, but it might in the future, and this is
more consistent anyway.
2021-10-22 12:17:28 -07:00
Martin von Zweigbergk
a9aff0b7fe cli: abandon the initial checkout after cloning Git repo
The CLI code for cloning a Git repo didn't use the usual
`finish_transaction()` method, because we didn't have support for
doing that on a repo that was creating half-way through a
command. That led to a bug where it would leave the initial checkout
(the one on top of the root commit) after checking out the correct
head.
2021-10-22 12:08:47 -07:00
Martin von Zweigbergk
c0ae4b16e8 trees: try to resolve file conflicts after simplifying conflicts
This fixes a bug I've run into somewhat frequently. What happens is
that if you have a conflict on top of another conflict and you resolve
the conflict in the bottom commit, we just simplify the `Conflict`
object in the second commit, but we don't try to resolve the new
conflict. That shows up as an unexpected "conflict" in `jj log`
output, and when you check out the commit, there are actually no
conflicts, so you can just `jj squash` right away.

This patch fixes that bug. It also teaches the code to work with more
than 3 parts in the merge, so if there's a 5-way conflict, for
example, we still try to resolve it if possible.
2021-10-22 09:20:50 -07:00
Martin von Zweigbergk
f1e2124a64 trees: make simplify_conflict() always return a Conflict
The interface is much cleaner this way. The function no longer makes
any writes to the store.
2021-10-20 22:07:42 -07:00
Martin von Zweigbergk
ffa727eb51 cli: add jj undo as shortcut for jj op undo
`jj undo` is probably what people would reach for first. It's also the
most commonly used `jj op` command, so it's nice to make it quick to
type.
2021-10-20 21:52:16 -07:00
Martin von Zweigbergk
ef616222a9 cli: rename ArgMatcher variables from *_matches to *_args
`args` seems to make it clear that these are command-line arguments
(this is not Python, so there's no `*args`). It also avoids the risk
of conflicts and confusion with other matches (e.g. file patterns or
regexes).
2021-10-20 21:46:08 -07:00