<commit_before>package main

import (
	"bytes"
	"errors"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"net/url"
	"regexp"
	"strconv"
	"strings"
	"text/template"
	"time"
)

var (
	addrFlag       = flag.String("addr", ":8080", "Serve HTTP at given address")
	socketFlag     = flag.String("socket", "", "Serve HTTP at given UNIX socket")
	vanityRootFlag = flag.String("vanity-root", "", "Vanity root URL (e.g.: https://upper.io).")
	repoRootFlag   = flag.String("repo-root", "", "Git repository root URL (e.g.: https://github.com/upper).")
)

var packagePattern = regexp.MustCompile(`^/([a-zA-Z0-9]+)\.?(v[1-9][0-9]*)?(.*)$`)

var httpClient = &http.Client{Timeout: 10 * time.Second}

const refsSuffix = ".git/info/refs?service=git-upload-pack"

// Error messages.
var (
	ErrNoRepo    = errors.New("repository not found")
	ErrNoVersion = errors.New("version reference not found")
)

func main() {
	if err := run(); err != nil {
		log.Fatalf("Could not start server: %q", err)
	}
}

func run() error {
	flag.Parse()

	if *addrFlag == "" && *socketFlag == "" {
		return fmt.Errorf("must provide -addr")<commit_msg>Allow dashes in repository names.<commit_after>package main

import (
	"bytes"
	"errors"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"net/url"
	"regexp"
	"strconv"
	"strings"
	"text/template"
	"time"
)

var (
	addrFlag       = flag.String("addr", ":8080", "Serve HTTP at given address")
	socketFlag     = flag.String("socket", "", "Serve HTTP at given UNIX socket")
	vanityRootFlag = flag.String("vanity-root", "", "Vanity root URL (e.g.: https://upper.io).")
	repoRootFlag   = flag.String("repo-root", "", "Git repository root URL (e.g.: https://github.com/upper).")
)

var packagePattern = regexp.MustCompile(`^/([-a-zA-Z0-9]+)\.?(v[1-9][0-9]*)?(.*)$`)

var httpClient = &http.Client{Timeout: 10 * time.Second}

const refsSuffix = ".git/info/refs?service=git-upload-pack"

// Error messages.
var (
	ErrNoRepo    = errors.New("repository not found")
	ErrNoVersion = errors.New("version reference not found")
)

func main() {
	if err := run(); err != nil {
		log.Fatalf("Could not start server: %q", err)
	}
}

func run() error {
	flag.Parse()

	if *addrFlag == "" && *socketFlag == "" {
		return fmt.Errorf("must provide -addr")
{'fraction_non_alphanumeric': 0.20097388224878265, 'fraction_numerical': 0.010624169986719787, 'mean_word_length': 3.860215053763441, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6084111', 'n_tokens_mistral': 877, 'n_tokens_neox': 855, 'n_words': 195}