-
Notifications
You must be signed in to change notification settings - Fork 72
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
toolkit: Add list-topics command #141
toolkit: Add list-topics command #141
Conversation
Reviews in this chain: |
revup/toolkit.py
Outdated
topics = TopicStack(git_ctx, args.base_branch, args.relative_branch) | ||
await topics.populate_topics() | ||
for topic in topics.topics.values(): | ||
topic_commits = " ".join(commit.commit_id for commit in topic.original_commits) |
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.
is the commit id specifically useful here? i'd think users would prefer having commit title instead
i'd recommend the following:
list-topics just prints topics newline separated
with --commit-id, lists commit ids newline separated as well. so there'd be 2 newlines between different topics
with --title, lists commit titles newline separated similar to above
that should in theory work with what you want and is more flexible. newline is so we don't run over the edge of the screen with topics that have a lot of commits
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.
is the commit id specifically useful here? i'd think users would prefer having commit title instead
Yes the commit id is much more useful for scripts that parse the output.
list-topics just prints topics newline separated
with --commit-id, lists commit ids newline separated as well. so there'd be 2 newlines between different topics
with --title, lists commit titles newline separated similar to above
Done. Might be worth considering doing something like " " followed by the list of commits instead of seperating topics by the double-newline, which I think is marginally simpler to parse from a script (and matches what git does in several places).
The list-topics command lists the topics for the current branch along with (optionally) the commit ID or commit title of all commits that are part of the topic. This is useful for scripts that needs a list of the available topics (e.g. in a prepare-commit-msg git hook). Signed-off-by: Brian Kubisiak <[email protected]>
e469eb4
to
05bbdcc
Compare
The list-topics command lists the topics for the current branch along
with (optionally) the commit ID or commit title of all commits that
are part of the topic. This is useful for scripts that needs a list of
the available topics (e.g. in a prepare-commit-msg git hook).
Signed-off-by: Brian Kubisiak [email protected]