Re: [dev] which versions are dwm patches intended to apply to cleanly?

From: Eric Pruitt <eric.pruitt_AT_gmail.com>
Date: Wed, 29 Jun 2016 16:23:50 -0700

On Wed, Jun 29, 2016 at 01:54:13PM -0800, Britton Kerin wrote:
> I'm not going to try to fix patches I don't use myself, it's possible
> to screw up and testing is a hassle since it involves the wm.

I wonder what the odds are of a patch applying cleanly, compilation of
of dwm succeeding but actually breaking dwm in the process. I'm thinking
this could be automated by attempting to apply the patches to HEAD,
renaming the ones that succeed and still allow dwm to build then doing
"git reset --hard HEAD^" and repeating the process. Maybe stop at the
dwm commit that comes before the oldest patch's commit date. Maybe
something like this:

    while ...; do
        git_version="$(git log -1 --format=%h)"

        for patch in *.diff; do
            # Getting the name part might be a little tricky, but maybe
            # it could be done by grepping for the patch path in the
            # markdown files e.g.:
            name="$(fgrep -m1 -l -w "$patch" *.md)"
            name="${name%.md}"

            if patch < "$patch" && make dwm; then
                git mv "$patch" "dwm-$name-$git_version.diff"
            fi

            make clean
            git reset --hard
        done

        git reset --hard HEAD^
    done

Note that this is an example and doesn't take into account that the
"sites" repo and dwm wouldn't be in the same folder.

Eric
Received on Thu Jun 30 2016 - 01:23:50 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 30 2016 - 01:36:05 CEST