Add subcomand 'pulls create' #144
Merged
6543
merged 13 commits from 6543/tea:pulls-create
into master
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch '6543/tea:pulls-create'
Deleting a branch is permanent. It CANNOT be undone. Continue?
complete #59
close #8
[Feature] pulls createto Add subcomand 'pulls create' 2 years agoIf no parameters, we just send the current branch to origin remote base repository's default branch.
@lunny didnt read your commit but was already on it ?
how do you like it now?
head := ctx.String("head")
// default is current one
if len(head) == 0 {
head = localRepo.TeaGetCurrentBranchName()
There is a chance that
head == ""
(ex. ifTeaGetCurrentBranchName
errors), should this be handled?good question I dont know yet ...
@techknowlogick
422 Unprocessable Entity: [{"fieldNames":["Head"],"classification":"RequiredError","message":"Required"},{"fieldNames":["Title"],"classification":"RequiredError","message":"Required"}]
title and head are required :)
So this is only for origin repository branches pull requests? No forked repository?
I'd like to get basic feature it first and enhance it later
so you can create pulls from forks but only manualy not automaticaly by branch remote rev
at the moment
@lunny @techknowlogick ready to review :)
Head: head,
Base: base,
Title: title,
Body: ctx.String("body"),
description
?Few nits
}
// push if possible
_ = localRepo.Push(&git.PushOptions{})
If this fails, even if it doesn't kill the whole operation, should it inform the user?
}
// title is required
if len(title) == 0 {
fmt.Printf("Can't create a title has to be set")
Maybe something like
log.Fatal(err)
}
fmt.Printf("#%d %s\n%s created %s\n", pr.Index,
Perhaps a link to the pull request here would be nice?
@jolheiser done
// push if possible
err = localRepo.Push(&git.PushOptions{})
if err != nil {
fmt.Printf("Error ocure on 'git push':\n%s\n", err.Error())
f1801f39a6
into master 2 years agof1801f39a6
.