WIP: Workhorse to serve raw commits
Merge request reports
Activity
- Resolved by Zeger-Jan van de Weg
- Resolved by Zeger-Jan van de Weg
Added 16 commits:
Either @nick.thomas or @jacobvosmaer-gitlab, could you review?
Ill keep this WIP for now, as the CE part might still need some work, although this can be merged before the CE part is done.
@nick.thomas would you like to do the first round?
- Resolved by Zeger-Jan van de Weg
- Resolved by Zeger-Jan van de Weg
- Resolved by Zeger-Jan van de Weg
- Resolved by Zeger-Jan van de Weg
- Resolved by Zeger-Jan van de Weg
- internal/git/show.go 0 → 100644
7 "net/http" 8 9 "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" 10 "gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata" 11 ) 12 13 type show struct{ senddata.Prefix } 14 type showParams struct { 15 RepoPath string 16 Sha string 17 Format string 18 } 19 20 var SendCommit = &show{"git-show-commit:"} 21 22 func (s *show) Inject(w http.ResponseWriter, r *http.Request, sendData string) { This looks mostly like a copy-paste of, say,
internal/git/format-patch.go:Inject
.I appreciate that's how the rest of them came into being, but have you investigated whether there's a refactor worth having?
Edited by Nick ThomasTo be honest, I have no clue how as most design patterns need inheritance.
Maybe I can use the functional features, but we'll see.
Edited by Zeger-Jan van de WegDesign patterns are a bit of a fraught topic in go :-D. Definitely prefer composition over inheritance, though!
- Resolved by Zeger-Jan van de Weg
Reassigned to @nick.thomas
24 28 cmd.Stderr = os.Stderr 25 29 return cmd 26 30 } 31 32 func execGitCommand(w http.ResponseWriter, r *http.Request, cmd *exec.Cmd) { 33 stdout, err := cmd.StdoutPipe() 34 if err != nil { 35 helper.Fail500(w, r, fmt.Errorf("execGitCommand: create stdout pipe: %v", err)) assigned to @zj
@nick.thomas Given there is no clear way forward to generate correct output Ill close this for now.
@zj that's too bad! On the other hand, closing this also makes sense now that we are building Gitaly. Thanks for working on this.