Skip to content

Script silently includes extra changes if a repo has local changes #20

@foolip

Description

@foolip

whatwg/dom#877 includes lots of other changes, where I had a .spec.whatwg.org directory in my dom/ checkout, after a bug fixed in whatwg/whatwg.org#325.

The script should either fail if there are any local changes, or just make fresh copies of all repos. As it is, it assumes you have all repos checkout out alongside spec-factory, but how to keep those up-to-date is an exercise for the reader. Here's the script I've arrived at over time:

#!/bin/bash -e

curl --silent --fail "https://api.github.com/orgs/whatwg/repos?per_page=100" | \
    #grep -E '^    "name":' | cut -d \" -f4 | \
    #grep -vE '^(domparsing|javascript|old-google-code-html5|resources.whatwg.org)$' | \
    jq -r '.[] | select(.archived == false) | .name' | sort | \
    while read name; do
        if [[ -d "$name" ]]; then
            echo "Updating $name"
            (
                cd "$name"
                git fetch --prune
                git rebase-update --no-fetch --keep-going
            )
        else
            echo "Cloning $name"
            git clone "[email protected]:whatwg/$name.git"
        fi
    done

It would be good if it just works instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions