Add subcomand 'pulls create' #144
No reviewers
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#144
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "6543/tea:pulls-create"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
complete #59
close #8
[Feature] pulls createto Add subcomand 'pulls create'If 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?
@ -267,0 +315,4 @@
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 :)
@ -267,0 +348,4 @@
Head: head,
Base: base,
Title: title,
Body: ctx.String("body"),
description
?Few nits
@ -267,0 +325,4 @@
}
// push if possible
_ = localRepo.Push(&git.PushOptions{})
If this fails, even if it doesn't kill the whole operation, should it inform the user?
@ -267,0 +340,4 @@
}
// title is required
if len(title) == 0 {
fmt.Printf("Can't create a title has to be set")
Maybe something like
@ -267,0 +355,4 @@
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
@ -267,0 +344,4 @@
// push if possible
err = localRepo.Push(&git.PushOptions{})
if err != nil {
fmt.Printf("Error ocure on 'git push':\n%s\n", err.Error())