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: add option to list only conflicted branches #3347

Merged
merged 1 commit into from
Mar 23, 2024

Conversation

Kintaro
Copy link
Contributor

@Kintaro Kintaro commented Mar 23, 2024

As requested in #1471, I added a new flag for jj branch list to only show branches that are conflicted.

Adds a unit test to check for listing only conflicted branches and regenerates the cli output to incorporate the new flag.

Closes #1471

reformat

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

@Kintaro Kintaro requested review from yuja and martinvonz March 23, 2024 07:28
@Kintaro Kintaro force-pushed the push-mwwroqwkzxxr branch from 2b5483f to 7677185 Compare March 23, 2024 08:16
Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

cli/tests/test_branch_command.rs Outdated Show resolved Hide resolved
cli/tests/test_branch_command.rs Outdated Show resolved Hide resolved
@Kintaro Kintaro force-pushed the push-mwwroqwkzxxr branch from 7677185 to 9957aa6 Compare March 23, 2024 12:05
@Kintaro
Copy link
Contributor Author

Kintaro commented Mar 23, 2024

I have updated it, but had to change the way I was retrieving the output, otherwise jj_cmd_success complained due to

stdout=
bar: kkmpptxz 06a973bc (empty) b
foo (conflicted):
  + rlvkpnrz d8d5f980 (empty) a
  + kkmpptxz 06a973bc (empty) b

stderr="Concurrent modification detected, resolving automatically.\n"

I hope that's ok. If there's a better way how this should be handled in jj, I will gladly change it.

@Kintaro Kintaro force-pushed the push-mwwroqwkzxxr branch 2 times, most recently from 0cf2dc1 to 633d9bb Compare March 23, 2024 12:24
@yuja
Copy link
Contributor

yuja commented Mar 23, 2024

I have updated it, but had to change the way I was retrieving the output, otherwise jj_cmd_success complained due to

The common pattern is let (stdout, stderr) = jj_cmd_ok(..). You can also insert some command (like jj status) before get_branch_output(). The diverged operations will be merged there.

As requested in jj-vcs#1471, I added a new flag for `jj branch list` to only show branches that are conflicted.

Adds a unit test to check for listing only conflicted branches and regenerates the cli output to incorporate the new flag.

Closes jj-vcs#1471

reformat
@Kintaro Kintaro force-pushed the push-mwwroqwkzxxr branch from 633d9bb to 39e6dc1 Compare March 23, 2024 12:29
@Kintaro
Copy link
Contributor Author

Kintaro commented Mar 23, 2024

Oh right, forgot about the internal operations log. I have added a jj status call and reverted the branch list --all and branch list --conflicted to use jj_cmd_success.

@Kintaro Kintaro merged commit 63771d6 into jj-vcs:main Mar 23, 2024
16 checks passed
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: Flag to only show conflicted branches
2 participants