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

Revamp hub issue commands #1099

Merged
merged 23 commits into from
Aug 16, 2016
Merged

Revamp hub issue commands #1099

merged 23 commits into from
Aug 16, 2016

Conversation

mislav
Copy link
Owner

@mislav mislav commented Feb 3, 2016

This marks hub issue family of commands coming out of beta.

  • hub issue cleaner output

    • doesn't include pull requests
    • red/green color based on closed/open state
    • list both open and closed issues with hub issue -s all
    screen shot 2016-02-03 at 11 32 53 pm
  • All commands reimplemented using simpleApi and not go-octokit

  • hub issue create small tweaks for compatibility with hub release create

Todo:

  • Implement other hub issue filtering options
    • Add hub issue --format=... option to choose which fields to output a la git log
  • List all pages of results from API (currently consuming just 1st page)
    • Cache previously fetched pages locally
  • hub issue edit command to change labels, assignee, closed/open state
    • hub issue comment command to add a comment to the thread?
  • Ability to list all your issues a la Issues Dashboard, i.e. not project-specific?
  • Flag to specify a repository to manage issues for, e.g. if not in a git working directory?

- `hub issue` now displays color based on issue open/closed state
- `hub issue` no longer displays HTML URL since it was noisy
- `hub issue` no longer lists pull requests
- `hub issue create` tweaks for compatibility with `hub release create`
cmdCreateIssue = &Command{
Key: "create",
Run: createIssue,
Usage: "issue create [-m <MESSAGE>|-f <FILE>] [-l <LABELS>]",
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe Usage and Long of subcommand are never used. Actually putting something in there can be misleading.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Usage should be displayed in cases when you passed an invalid flag, and Usage and Long are both used for generating documentation for a command.

Copy link
Contributor

Choose a reason for hiding this comment

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

Usage and Long are both used for generating documentation for a command.

That is not true today for subcommands: either open an issue to make hub help issue create display the help for the subcommand, or just remove the doc here.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oops, you're right. For subcommands, these fields aren't consulted yet. For now, let's keep them up to date still, at least as some sort of "code" documentation, and we'll figure out how to hook subcommands into the global help system.

@krlmlr
Copy link

krlmlr commented Feb 19, 2016

I can confirm that this PR also works with Ubuntu 15.10 (where hub 2.2.3 failed to retrieve anything). Sweet, thanks!

@mislav
Copy link
Owner Author

mislav commented Aug 16, 2016

@pcorpet I've pushed some extra features and will merge this to master as the first iteration of the new issue command. Additional upgrades should come in form of separate PRs.

  • Add multiple assignees & milestone support
  • Add hub issue create --browse flag
  • --format placeholders renamed & expanded (see below)
  • All pages of API results now fetched. We'll have to figure out some caching strategy.
%I: issue number

%i: issue number prefixed with "#"

%U: the URL of this issue

%S: state (i.e. "open", "closed")

%sC: set color to red or green, depending on issue state.

%t: title

%l: colored labels

%L: raw, comma-separated labels

%b: body

%au: login name of author

%as: comma-separated list of assignees

%Mn: milestone number

%Mt: milestone title

%NC: number of comments

%Nc: number of comments wrapped in parentheses, or blank string if zero.

%cD: created date-only (no time of day)

%cr: created date, relative

%ct: created date, UNIX timestamp

%cI: created date, ISO 8601 format

%uD: updated date-only (no time of day)

%ur: updated date, relative

%ut: updated date, UNIX timestamp

%uI: updated date, ISO 8601 format

Instead, specify timezone offsets explicitly so that different
environments interpret the time identically.
@mislav mislav merged commit 19f9fa4 into master Aug 16, 2016
@mislav mislav deleted the revamp-issues branch August 16, 2016 16:54
@pcorpet
Copy link
Contributor

pcorpet commented Aug 17, 2016

Cool, thanks. Do you have an idea of a feature / issue I could help with to get a new release of hub with the code currently in master? (I saw you created a 2.2.5 but it seems to cherry-pick only some small fixes).

@mislav
Copy link
Owner Author

mislav commented Aug 17, 2016

Do you have an idea of a feature / issue I could help with to get a new release of hub with the code currently in master?

Your help is greatly appreciated. Here are my ideas for the next release: #1232

Obviously, not everything will probably make it in. I'm leaving on vacation for 2 weeks next week, so by the end of this week I was thinking to try to push a prerelease with the stuff currently in master.

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