Commit graph

27 commits

Author SHA1 Message Date
Sam Coe
9acbf8aae4
Refactor regexp writer 2020-11-03 09:59:40 +03:00
Sam Coe
bf46b870cb
Add multiple writes test 2020-11-03 09:59:39 +03:00
Sam Coe
eaa685ac9b
Use custom scanLines function for RegexWriter 2020-11-03 09:59:38 +03:00
Sam Coe
212993632b
Fix up regex to escape dot in URL 2020-11-03 09:59:11 +03:00
Sam Coe
28b3b2c9e7
Address PR comments 2020-11-03 09:59:09 +03:00
Ian Billett
0f61272333 Allow PullRequestForBranch to search in closed pull requests 2020-10-28 15:50:59 +01:00
Mislav Marohnić
4b395c5dd2
Merge pull request #2234 from XD-DENG/stringsbuilder
Use strings.Builder for more efficient string concatenation
2020-10-21 18:22:43 +02:00
Mislav Marohnić
d5cb5574d0 💅 simplify generateCompareURL and test 2020-10-21 12:09:46 +00:00
Leonardo
d0bee19eaf Query escape branch names to allow branch/#123 names 2020-10-21 12:09:46 +00:00
XD-DENG
7e9f1c7147 Use strings.Builder for more efficient string concatenation
It minimizes memory copying.

Reference: https://golang.org/pkg/strings/#Builder
2020-10-19 20:51:51 +02:00
Dimitris Apostolou
6f550b5d12
Fix typos 2020-10-04 22:16:30 +03:00
Harsh Shandilya
0107b00043
Don't override user provided title and body when --fill is used (#1994)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-30 16:15:30 +02:00
Mislav Marohnić
80b60fc6a9 Fix pr create for branches published under a different name 2020-09-24 11:35:02 +02:00
Mislav Marohnić
e2efc0b8a3 Fix pr create when branch was already pushed to a non-base remote 2020-09-23 19:53:27 +02:00
Mislav Marohnić
f99a55438f Remove issue create examples from pr create 2020-09-16 15:48:13 +02:00
Mislav Marohnić
7a8db80420 Prompt for push target during pr create
We no longer guess the head repository using heuristics; instead, we
present the user with the choice of pushable repositories and an
additional option to create a new fork.

The new `pr create --head` flag is available for the user to specify the
head branch in `branch` or `owner:branch` format and completely skip any
forking or auto-pushing checks.
2020-09-16 14:49:36 +02:00
Mislav Marohnić
d534a94d1b Change how base repository is resolved
On first run in a git repository, `BaseRepo()` will now prompt the user
which repository should be queried as base repository if there are
multiple git remotes or when we are in the context of a fork.

In non-interactive mode, the prompt is skipped and we default to the
first git remote instead.

After the base repo is resolved, the result is cached in the local
repository using `git config` so that RepositoryNetwork API lookups can
be avoided in the future.
2020-09-15 21:27:12 +02:00
vilmibm
1073c97409 review feedback 2020-09-11 11:36:24 -05:00
vilmibm
c0fc31f7d5 use CanPrompt in commands 2020-09-10 12:13:48 -05:00
Daniel Leong
c7e702203b Update template test to reflect inclusion of "default" text
Also, avoid excessive amounts of newlines separating the two
2020-09-08 20:25:52 -04:00
Daniel Leong
41543b564d "Check" the error value of ioutil.WriteFile
We could, alternatively, use t.Fatal... this matches the MkdirAll
invocation from github_template_test, however...
2020-09-08 20:12:28 -04:00
Daniel Leong
a33124414c Add a test to verify the behavior of prepending commit body to message 2020-09-08 20:12:28 -04:00
Nate Smith
c2d7cbf51f
Merge pull request #1582 from AliabbasMerchant/interactiveCreationTests
Interactive template selection test for issue create
2020-09-08 16:55:04 -05:00
AliabbasMerchant
9e7279604d Fix failing tests for Windows (due to line-ending issues) 2020-09-02 10:03:56 +05:30
AliabbasMerchant
51c5595cad Interactive template selection test for PR create 2020-09-02 09:56:28 +05:30
Mislav Marohnić
766e4950d9 Be transparent about which part of pr create flow failed
When applying metadata to the new PR such as assignees or reviewers, if
the operation fails, an error message would get printed:

    failed to create pull request: <API error text>

This was misleading, because the PR did get created; it's just that
updating it failed. The new error message is:

    https://github.com/OWNER/REPO/pull/123
    pull request update failed: <API error text>

The PR URL is printed on stdout and the error message is printed on
stderr. In case of any errors, the exit code is still non-zero.
2020-08-31 16:46:22 +02:00
Mislav Marohnić
558e3f3dea Isolate pr create command 2020-08-04 18:29:42 +02:00