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

log: emit working-copy branch first if included in the revset #4902

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Nov 18, 2024

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

@tim-janik
Copy link
Contributor

tim-janik commented Nov 18, 2024

Wow, live editing with jj-fzf works much better with this change applied when describing commits not on the working copy.
The one thing left to wish for is stabilizing the order of siblings, but swapping sibling branches not related to the working copy is triggered less frequently than anything involving the working copy:

⮞ jj log
@  kwn
│ ○  kzw D
├─╯
│ ○  oll C
├─╯
○  xpx B
○  soq A
⮞ jj desc -m C2 -r 'description(exact:"C\n")' && jj log
@  kwn
│ ○  oll C2
├─╯
│ ○  kzw D
├─╯
○  xpx B
○  soq A

@yuja yuja force-pushed the push-sstomzpyolwy branch from 9bb97bf to 7526217 Compare November 19, 2024 02:40
@yuja
Copy link
Contributor Author

yuja commented Nov 19, 2024

⮞ jj log
@  kwn
│ ○  kzw D
├─╯
│ ○  oll C
├─╯
○  xpx B
○  soq A
⮞ jj desc -m C2 -r 'description(exact:"C\n")' && jj log
@  kwn
│ ○  oll C2
├─╯
│ ○  kzw D
├─╯
○  xpx B
○  soq A

This wouldn't get stable order based on generation number either. We would need a weird tie-breaking rule such as heads are sorted by change ID, not by timestamp.

I think a UI will have to retain some state to avoid node reordering. For example, a set of head change ids can be queried first, then pass it to jj log --config-toml=prioritized_branches=[...] or something to enforce the order.

@yuja yuja force-pushed the push-sstomzpyolwy branch from 7526217 to fffb20c Compare November 19, 2024 12:19
Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I mentioned this PR on Discord too and we haven't heard any concerned raised, so I'm fine if you want to merge this now.

yuja added 2 commits November 20, 2024 10:37
The working-copy revision is usually the latest commit, but it's not always
true. This patch ensures that the wc branch is emitted first so the graph node
order is less dependent on rewrites.
@yuja yuja force-pushed the push-sstomzpyolwy branch from fffb20c to ce71b3f Compare November 20, 2024 01:38
@yuja yuja enabled auto-merge (rebase) November 20, 2024 01:44
@yuja yuja merged commit 1973c71 into jj-vcs:main Nov 20, 2024
18 checks passed
@yuja yuja deleted the push-sstomzpyolwy branch November 20, 2024 01:50
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.

3 participants