Skip to content

Conversation

@SolaWing
Copy link

@SolaWing SolaWing commented Aug 6, 2016

as #17, I rewrote sort to support sorting sections. This will ease the pain of Xcode reordering sections and causing huge modifications.

@truebit
Copy link
Owner

truebit commented Oct 15, 2016

@SolaWing hi, sorry for the late reply.
Thanks for your PR.
As this one is a major change, have you tested on any project file?
I think the quick and lazy verification test is to find some complicated project files being xuniqued twice, to see if they were the same without any error exit.

@ZSaberLv0
Copy link

not fully tested, but this PR did solve section sorting problem for my case, without any other side effect @truebit

@SolaWing
Copy link
Author

SolaWing commented Oct 5, 2017

After the first PR, I also fixed some found problem.
The final commit has been used in our team 1 year without any problem.

Maybe we should add auto test?

following is our team's precommithook:

IFS=$'\n' projs=($(git diff --name-only --cached --diff-filter=ACM | grep -o '[a-zA-Z0-9_./]\+\.xcodeproj/project.pbxproj'))
if ((${#projs[@]} > 0)); then
    if command -v python3 >/dev/null 2>&1; then
        py='python3'
    else
        py='python'
    fi
    # set -x
    for proj in ${projs[@]}; do
        $py xUnique.py -c "$proj";
        ret=$?
        if (($ret == 100)); then
            git add "$proj"
        elif (($ret > 0)); then
            echo 'xcodeproj file may broken! check the exception message please'
            echo 'you may add `--no-verify` option for commit to skip checking xcodeproj'
            exit 1
        fi
    done
    if [[ ! $(git diff --name-only --cached | grep -o '[a-zA-Z0-9_./]\+\.xcodeproj/project.pbxproj') ]]; then
        echo 'no changes, commit abort'
        exit 1
    fi
fi

@truebit
Copy link
Owner

truebit commented Oct 16, 2017

@SolaWing Thanks for the input.
auto test is not a very good alternative, as special project files causing problems are normally from private code, those files cannot be included as a testcase 😟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants