-
Notifications
You must be signed in to change notification settings - Fork 346
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: migrate "tag list" to template #3595
Conversation
Looks good to me, but I haven't contributed to jj in a while so I'll let someone else approve. This PR seems to do 3 things:
These all seem reasonable to me and are very clearly laid out in this series of commits. I can't judge if the functions are what the jj project wants long-term (whether naming or functionality) so I'll let someone else approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm as well, looking forward to the follow up for branch list templates
Thanks. I'll merge this PR after the release. This wouldn't be that useful without branch templating. |
I'm going to add ref_name.target*() template methods so the commit templater can be reused for branches/tags templates. RefTarget could be looked up by (name, kind) pair, but it's simpler to store it in RefName.
It will be called from cmd_tag_list().
I'll update the test to include conflicted tag, which can't be easily set up by fetching from remote.
I'm going to add more detailed output there. This is a step towards "branch list" template. "tag list -T" wouldn't be that useful, but it shares primitives with "branch list -T".
"working_copy tag" wouldn't be needed, but is added for consistency.
I considered adding RefTarget template type, but some of the methods naturally fit to RefName. For example, a conflicted branch name is decorated as "??", so it makes sense to add branch.conflict() instead of branch.target().conflict(). I'm not pretty sure how many RefName methods we'll need to add to port the current branch listing, but there will be .tracked(), .tracking_local_present(), .ahead_by(), and .behind_by().
This is basically a template version of print_branch_target().
Checklist
If applicable:
CHANGELOG.md