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 git push: no-op refactor of message printing #3811

Closed
wants to merge 1 commit into from

Conversation

ilyagr
Copy link
Collaborator

@ilyagr ilyagr commented Jun 1, 2024

This is based on the commit from #3765 and refactors things some. I could also include this in #3765, or we could reject this PR entirely if it doesn't seem to help.

@ilyagr ilyagr marked this pull request as ready for review June 1, 2024 20:01
@ilyagr ilyagr force-pushed the fwl-msg2 branch 2 times, most recently from 1f7e9b5 to 82d797b Compare June 2, 2024 01:43
Attempting to simplify the code a bit.
MoveBackward { old: String, new: String },
MoveSideways { old: String, new: String },
Add(String),
Delete { old: String },
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think mixing UI logic like this is useful.

Let's say we had jj-lib function that classifies branch movements (as well as conflicts), it might return

enum BranchPushUpdate {
    Move { old: CommitId, new: CommitId, movement: Forward|Backward|Sideways },
    Add(CommitId),
    Delete(CommitId),
}

I don't know if this data structure is useful, but it might make sense if we have more than one jj <forge> push commands (or backend needs to know the movement types.) OTOH, BranchPushLabel is basically a UI string constructed from BranchPushUpdate.

Copy link
Collaborator Author

@ilyagr ilyagr Jun 3, 2024

Choose a reason for hiding this comment

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

I'll just close this then.

I was wondering whether to use String vs CommitId, but I thought them essentially equivalent; we could always change one to the other if it started to matter. I thought it might be a mild improvement to collect most of the UI logic in fewer places, but it doesn't matter much, and perhaps you have your own ideas of what you want to do with this code.

@ilyagr ilyagr closed this Jun 3, 2024
@ilyagr ilyagr deleted the fwl-msg2 branch August 13, 2024 01:05
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.

2 participants