Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: apply log --limit before --reversed #5473

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Jan 26, 2025

Closes #5403

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

CHANGELOG.md Show resolved Hide resolved
cli/src/commands/evolog.rs Outdated Show resolved Hide resolved
yuja added 2 commits January 26, 2025 18:53
The implementation isn't specific to revset, and is short.
As I said, I don't have strong feeling about the current behavior, and appears
that "log | head | reverse" is preferred over "log | reverse | head".
"jj evolog" already behaves differently, so I just updated the doc.

Note that the new behavior might be slightly different from git, but nobody
would care. (iirc, in git, topological sorting comes later.)

Closes jj-vcs#5403
@yuja yuja force-pushed the push-mmppkyzuuvwv branch from f8afe25 to 83ed830 Compare January 26, 2025 09:54
@yuja yuja added this pull request to the merge queue Jan 27, 2025
Merged via the queue into jj-vcs:main with commit dcca181 Jan 27, 2025
19 checks passed
@yuja yuja deleted the push-mmppkyzuuvwv branch January 27, 2025 01:49
@ilyagr
Copy link
Contributor

ilyagr commented Jan 27, 2025

I find the output of --limit --reversed now to be a bit confusing when many branches (in the topological sense) split off the same old commit on main.

I'm referring to the first 7 commits in this output (I deleted some irrelevant commits, so there aren't 20 commits in the picture):

% jj log --limit 20 --reversed
○  wlxpnk bsdinis@mit. 3 days ago pr/5441 03698cd
   insta: run --force-update-snapshots
○  nxrott ilyagr@users 3 days ago 2b50217
│  insta test
○  pvoxqo ilyagr@users 3 days ago 1978416
   errors
○    wlsqrn ilyagr@users 3 days ago 00cf4b9
├─╮  smaller set of files
│ ○  vuzoxm ilyagr@users 3 days ago 02dc4f2
│    minimal errors
○  nksnlk ilyagr@users 3 days ago b58e6e4
   (no description set)
○  yqtslm ilyagr@users 3 days ago f727420
   (no description set)
◆    zqqnzn ilyagr@users 3 days ago bb74a9e
├─╮  config.md: document how to install Meld (on a Mac, especially)
~ │  (elided revisions)
│ ○  kuottw ilyagr@users 2 days ago ig/codespell 91c8a5f
│    codespell action: use `uv` to run codespell
◆    osyzuk 49699333+dep 2 days ago f3bbc50
├─╮  github: bump the github-dependencies group with 2 updates
~ │  (elided revisions)
│ ○  tvrmvq ilyagr@users 1 day ago bf294a3
│ │  print-page
│ ○  kprnrz ilyagr@users 1 day ago docs-single-page 9c1801b
│    add urls
@  xkttkv ilyagr@users 8 minutes ago 1f3f59d
   (empty) (no description set)
Unredacted version with 20 commits, also shows what a mega-merge looks like

(Probably not super-relevant, but might be interesting to some)

% jj log --limit 20 --reversed
○  wlxpnk bsdinis@mit. 3 days ago pr/5441 03698cd
   insta: run --force-update-snapshots
○  nxrott ilyagr@users 3 days ago 2b50217
│  insta test
○  pvoxqo ilyagr@users 3 days ago 1978416
   errors
○    wlsqrn ilyagr@users 3 days ago 00cf4b9
├─╮  smaller set of files
│ ○  vuzoxm ilyagr@users 3 days ago 02dc4f2
│    minimal errors
○  nksnlk ilyagr@users 3 days ago b58e6e4
   (no description set)
○  yqtslm ilyagr@users 3 days ago f727420
   (no description set)
◆    zqqnzn ilyagr@users 3 days ago bb74a9e
├─╮  config.md: document how to install Meld (on a Mac, especially)
~ │  (elided revisions)
│ ○  kuottw ilyagr@users 2 days ago ig/codespell 91c8a5f
│    codespell action: use `uv` to run codespell
◆    osyzuk 49699333+dep 2 days ago f3bbc50
├─╮  github: bump the github-dependencies group with 2 updates
~ │  (elided revisions)
│ ○  tvrmvq ilyagr@users 1 day ago bf294a3
│ │  print-page
│ ○  kprnrz ilyagr@users 1 day ago docs-single-page 9c1801b
│    add urls
◆      muqzov [email protected] 2 hours ago main dcca181
├─┬─╮  cli: apply log --limit before --reversed
│ │ ○    xuywkq ilyagr@users 19 minutes ago d03b90a
│ │ ├─╮  pager: refactor pager config (no-op)
│ │ │ ○  qpnnkx ilyagr@users 19 minutes ago streamopts-direct baae872
│ │ │    built-in pager: allow configuring streampager options
│ ○ │  plpsvw ilyagr@users 19 minutes ago b26ca6b
│ │ │  build.rs: separate commit ids if compiling at a merge commit
│ │ ○  ovwtzo ilyagr@users 19 minutes ago ig/streamopts* streamopts 5b41736
│ ├─╯  built-in pager: allow configuring streampager options
○ │  znyxps ilyagr@users 12 minutes ago push-name git_head() c139255
├─╮  cli `git push`: new `--name` argument to specify bookmark created by `--change`
│ ◌  mluups ilyagr@users 12 minutes ago ilya 1646ea6
│    (empty) Merge
@  xkttkv ilyagr@users 12 minutes ago 1f3f59d
   (empty) (no description set)

The normal direction is pretty clear (I deleted some irrelevant commits, so the count is off):

% jj log --limit 20
@  xkttkv ilyagr@users 7 minutes ago 1f3f59d
│  (empty) (no description set)
◆  muqzov [email protected] 2 hours ago main dcca181
│  cli: apply log --limit before --reversed
~  (elided revisions)
│ ○  kprnrz ilyagr@users 1 day ago docs-single-page 9c1801b
│ │  add urls
│ ○  tvrmvq ilyagr@users 1 day ago bf294a3
├─╯  print-page
◆  osyzuk 49699333+dep 2 days ago f3bbc50
│  github: bump the github-dependencies group with 2 updates
~  (elided revisions)
│ ○  kuottw ilyagr@users 2 days ago ig/codespell 91c8a5f
├─╯  codespell action: use `uv` to run codespell
◆  zqqnzn ilyagr@users 3 days ago bb74a9e
│  config.md: document how to install Meld (on a Mac, especially)
~  (elided revisions)
│ ○  yqtslm ilyagr@users 3 days ago f727420
├─╯  (no description set)
│ ○  nksnlk ilyagr@users 3 days ago b58e6e4
│ │  (no description set)
│ │ ○  vuzoxm ilyagr@users 3 days ago 02dc4f2
│ ├─╯  minimal errors
│ ○  wlsqrn ilyagr@users 3 days ago 00cf4b9
├─╯  smaller set of files
│ ○  pvoxqo ilyagr@users 3 days ago 1978416
│ │  errors
│ ○  nxrott ilyagr@users 3 days ago 2b50217
├─╯  insta test
│ ○  wlxpnk bsdinis@mit. 3 days ago pr/5441 03698cd
├─╯  insta: run --force-update-snapshots

One possible solution would be to strongly err towards showing the immutable commit that all these branches end with. I'm not sure what is best (and maybe others won't run into this), but wanted to make you aware of this.

Another solution would be to have some analogue of the branches all merging together, like at the bottom of the normal direction log. I wonder what, if anything, Sapling does.

@yuja
Copy link
Contributor Author

yuja commented Jan 27, 2025

I think the output is identical to the one root commits are filtered out by -rREVSET?

Reversed graph doesn't have edges towards omitted roots (in the same way as forward graph doesn't have edges towards omitted heads.) That's not a new problem. I have no idea how that can be addressed.

@ilyagr
Copy link
Contributor

ilyagr commented Jan 27, 2025

Yes, I couldn't find any way to show a reversed graph in Sapling. So, I guess it doesn't have graph drawing primitives for this at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR: jj log --limit=10 --reversed should show the 10 most recents commits
3 participants