Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Default the run verbs to origin

2e6aa96e0182a7c682a12454793afed73cff9c9e · Keenan Nemetz · 15m ago · parent 92d8afc8

Default the run verbs to origin

The run commands passed an empty remote to the client, which asks git for a
remote named "" and refuses. Every other metadata command means origin when
--remote is omitted; the read verbs and the existing cancel and rerun verbs now
do the same.

cmd/vole/run.go +14−4

@@ -108,7 +108,7 @@ func runList(f *flags) error {
108 108 }
109 109 limit = n
110 110 }
111 list, err := client.ListRuns("", f.one("remote"), state, strings.TrimSpace(f.one("branch")),
111 list, err := client.ListRuns("", runRemote(f), state, strings.TrimSpace(f.one("branch")),
112 112 strings.TrimSpace(f.one("commit")), limit)
113 113 if err != nil {
114 114 return err
@@ -136,7 +136,7 @@ func runShow(f *flags) error {
136 136 if len(f.rest) != 1 {
137 137 return usagef("usage: vole run show <id> [--remote <name|url>]")
138 138 }
139 out, err := client.ShowRun("", f.one("remote"), f.rest[0])
139 out, err := client.ShowRun("", runRemote(f), f.rest[0])
140 140 if err != nil {
141 141 return err
142 142 }
@@ -159,7 +159,7 @@ func runLogs(f *flags) error {
159 159 if err != nil {
160 160 return err
161 161 }
162 return client.StreamRunLog("", f.one("remote"), f.rest[0], attempt, step, os.Stdout)
162 return client.StreamRunLog("", runRemote(f), f.rest[0], attempt, step, os.Stdout)
163 163 }
164 164
165 165 func runAction(sub string, f *flags) error {
@@ -173,7 +173,7 @@ func runAction(sub string, f *flags) error {
173 173 if sub == "rerun" {
174 174 action = client.RerunRun
175 175 }
176 out, err := action("", f.one("remote"), f.rest[0])
176 out, err := action("", runRemote(f), f.rest[0])
177 177 if err != nil {
178 178 return err
179 179 }
@@ -181,6 +181,16 @@ func runAction(sub string, f *flags) error {
181 181 return nil
182 182 }
183 183
184 // runRemote is the instance every run verb talks to. An omitted --remote means
185 // origin, the same default the metadata commands use; the client needs a name, and
186 // an empty one is not "whatever git picks".
187 func runRemote(f *flags) string {
188 if remote := strings.TrimSpace(f.one("remote")); remote != "" {
189 return remote
190 }
191 return "origin"
192 }
193
184 194 // positiveOrZero reads an optional index. Zero is the server's "choose the default",
185 195 // which is what an omitted flag means.
186 196 func positiveOrZero(raw, flag string) (int, error) {