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: print commits abandoned by git::import_refs() or fetch() #2311

Merged
merged 5 commits into from
Oct 2, 2023

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Sep 30, 2023

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

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! This seems useful.

By the way, one advantage of having jj git sync command is that it can avoid showing some of the conflicted commits to the user.

@yuja yuja force-pushed the push-lovswysxspvs branch from 5dda81f to 54143c8 Compare October 1, 2023 08:56
yuja added 4 commits October 2, 2023 03:22
This wasn't a problem before, but we wouldn't want to report previously-hidden
commits as abandoned.
I'll make it a bit more verbose if mut_repo().has_changes().
This will probably help to understand why you've got conflicts after fetching.
Maybe we can also report changed local refs.

I think the stats should be redirected to stderr, but we have many other similar
messages printed to stdout. I'll probably fix them all at once later.
cli/src/cli_util.rs Outdated Show resolved Hide resolved
…git import

Otherwise, it's unclear why "jj status" abandoned commits for example.
@yuja yuja force-pushed the push-lovswysxspvs branch from 54143c8 to e301b4a Compare October 2, 2023 04:27
Copy link
Contributor

@ilyagr ilyagr left a comment

Choose a reason for hiding this comment

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

I'm still a bit uneasy about this (whether it will create confusion, especially for beginners that didn't notice the abandoned commits and don't quite understand what it means), but this is clearly useful for people who notice the abandoned commits themselves. I think there's a good chance it's fine. We should try this version and see how (and whether) people react.

Yuya mentioned something intersting about this triggering unexpected test changes. I'll leave it up to him whether to look into it before or after merging this.

@yuja yuja merged commit 480efc1 into jj-vcs:main Oct 2, 2023
15 checks passed
@yuja yuja deleted the push-lovswysxspvs branch October 2, 2023 08:31
@ilyagr
Copy link
Contributor

ilyagr commented Oct 2, 2023

Here's the first time this PR became really noticeable. Most (all?) of these branches were moved, not deleted. I can't yet decide whether I like it or whether it will confuse people. We'll see :)

image

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