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: include untracked remote branches in default immutable_heads() #4083

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

yuja
Copy link
Collaborator

@yuja yuja commented Jul 14, 2024

I used to use "remote_branches() & ~mine()" to exclude "their" branches from the default log, and I don't think that's uncommon requirement. Suppose untracked branches are usually read-only, it's probably okay to make them immutable by default.

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
Collaborator

@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 think this is a good idea. Nice!

It seems like this will affect the default log revset automatically? See my other comment. Ultimately, I think the new behavior would be quite sensible.

If so, the worst I imagine happening is that people will be confused by the change to jj log default output, and maybe we should document in more places that you need to jj track branches for them to show up in the default jj log.

There is still a chance there is some other problem neither of us sees, but I think this would be nice to test out on anyone using the master branch.

Still, let's wait for a day before merging, in case others have comments (for example, if anyone wants us to wait longer).

CHANGELOG.md Show resolved Hide resolved
@ilyagr
Copy link
Collaborator

ilyagr commented Jul 14, 2024

Also, I'll cc the discussion on local(), #3529 . I haven't been following that conversation carefully, but on one hand it is discussing similar issues, and on the other hand if we do come up with some local() revset it might be appropriate to add something based on ~local() to the immutable heads.

@scott2000
Copy link
Collaborator

I'm definitely in favor of this change. The main motivation for my PR for adding untracked_remote_branches() was so that I could add this to my immutable_heads() (mainly for the way it cleans up the log), and I imagine it would be a reasonable default for most people.

I also think it makes sense semantically for these commits to be immutable. Rewriting commits on untracked branches generally doesn't seem like a good idea since the remote branch will remain at the old commit even after it is rewritten, which probably isn't what a user would intend.

I used to use "remote_branches() & ~mine()" to exclude "their" branches from
the default log, and I don't think that's uncommon requirement. Suppose
untracked branches are usually read-only, it's probably okay to make them
immutable by default.
@yuja yuja force-pushed the push-tkvztuxuwotp branch from 3106066 to 94a9703 Compare July 14, 2024 05:13
Copy link
Owner

@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.

Good idea

@yuja yuja merged commit ea3a574 into martinvonz:main Jul 15, 2024
17 checks passed
@yuja yuja deleted the push-tkvztuxuwotp branch July 15, 2024 14:41
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.

4 participants