diff --git a/command/issue.go b/command/issue.go index 9e3ce43de..39c34feca 100644 --- a/command/issue.go +++ b/command/issue.go @@ -104,6 +104,8 @@ func issueList(cmd *cobra.Command, args []string) error { return err } + fmt.Fprintf(colorableErr(cmd), "\nIssues for %s/%s\n\n", baseRepo.RepoOwner(), baseRepo.RepoName()) + issues, err := api.IssueList(apiClient, baseRepo, state, labels, assignee, limit) if err != nil { return err @@ -242,6 +244,8 @@ func issueCreate(cmd *cobra.Command, args []string) error { return err } + fmt.Fprintf(colorableErr(cmd), "\nCreating issue in %s/%s\n\n", baseRepo.RepoOwner(), baseRepo.RepoName()) + var templateFiles []string if rootDir, err := git.ToplevelDir(); err == nil { // TODO: figure out how to stub this in tests diff --git a/command/issue_test.go b/command/issue_test.go index 47924e865..78189e4c7 100644 --- a/command/issue_test.go +++ b/command/issue_test.go @@ -133,7 +133,11 @@ func TestIssueList_withFlags(t *testing.T) { } eq(t, output.String(), "") - eq(t, output.Stderr(), "No issues match your search\n") + eq(t, output.Stderr(), ` +Issues for OWNER/REPO + +No issues match your search +`) bodyBytes, _ := ioutil.ReadAll(http.Requests[0].Body) reqBody := struct { diff --git a/command/pr.go b/command/pr.go index 4d0c8d2ee..d63f3379a 100644 --- a/command/pr.go +++ b/command/pr.go @@ -137,6 +137,8 @@ func prList(cmd *cobra.Command, args []string) error { return err } + fmt.Fprintf(colorableErr(cmd), "\nPull requests for %s/%s\n\n", baseRepo.RepoOwner(), baseRepo.RepoName()) + limit, err := cmd.Flags().GetInt("limit") if err != nil { return err diff --git a/command/pr_create.go b/command/pr_create.go index 7ce86ece7..6cacaa451 100644 --- a/command/pr_create.go +++ b/command/pr_create.go @@ -46,6 +46,16 @@ func prCreate(cmd *cobra.Command, _ []string) error { return err } + target, err := cmd.Flags().GetString("base") + if err != nil { + return err + } + if target == "" { + target = "master" + } + + fmt.Fprintf(colorableErr(cmd), "\nCreating pull request for %s into %s in %s/%s\n\n", utils.Cyan(head), utils.Cyan(target), repo.RepoOwner(), repo.RepoName()) + if err = git.Push(remote, fmt.Sprintf("HEAD:%s", head)); err != nil { return err } diff --git a/command/pr_create_test.go b/command/pr_create_test.go index badfe7204..96ac2eb25 100644 --- a/command/pr_create_test.go +++ b/command/pr_create_test.go @@ -116,7 +116,11 @@ func TestPRCreate_web(t *testing.T) { eq(t, err, nil) eq(t, output.String(), "") - eq(t, output.Stderr(), "Opening https://github.com/OWNER/REPO/pull/feature in your browser.\n") + eq(t, output.Stderr(), ` +Creating pull request for feature into master in OWNER/REPO + +Opening https://github.com/OWNER/REPO/pull/feature in your browser. +`) eq(t, len(ranCommands), 3) eq(t, strings.Join(ranCommands[1], " "), "git push --set-upstream origin HEAD:feature") @@ -155,5 +159,9 @@ func TestPRCreate_ReportsUncommittedChanges(t *testing.T) { eq(t, err, nil) eq(t, output.String(), "https://github.com/OWNER/REPO/pull/12\n") - eq(t, output.Stderr(), "Warning: 1 uncommitted change\n") + eq(t, output.Stderr(), `Warning: 1 uncommitted change + +Creating pull request for feature into master in OWNER/REPO + +`) } diff --git a/command/pr_test.go b/command/pr_test.go index 91ec11a13..360b6d852 100644 --- a/command/pr_test.go +++ b/command/pr_test.go @@ -183,7 +183,11 @@ func TestPRList_filtering(t *testing.T) { } eq(t, output.String(), "") - eq(t, output.Stderr(), "No pull requests match your search\n") + eq(t, output.Stderr(), ` +Pull requests for OWNER/REPO + +No pull requests match your search +`) bodyBytes, _ := ioutil.ReadAll(http.Requests[0].Body) reqBody := struct {