git-rebaseの戻りコード1は何ですか?どのような他の値を返すことができますか?

git-rebaseの戻りコード1は何ですか?どのような他の値を返すことができますか?

マスターの変更を取り、すべてのブランチに適用するスクリプトがあります。このスクリプトはリリースにタグを付けて開発ブランチを使用するので、私たちにとってうまくいきます。私たちは各バージョンごとに別々の分岐を維持しません。

git-rebase最近、戻りコード1のため失敗し始めました。デバッグ中の状況は次のとおりです。

$ bash -x ./master-merge.sh 
++ git rev-parse HEAD
+ [[ -z 66dc925f94c15f92d0a2f16a03d8776df33e9144 ]]
+ ret_code=0
++ git rev-parse --abbrev-ref HEAD
+ current=master
+ git fetch --all
+ [[ 0 -eq 0 ]]
++ git branch -vv
++ grep -v ': gone]'
++ awk '{print $1}'
+ for branch in '$(git branch -vv | grep -v ": gone]" | awk '\''{print $1}'\'')'
+ '[' -e detsig ']'
+ echo 'Merging detsig'
Merging detsig
+ git checkout detsig
+ [[ 0 -ne 0 ]]
+ git rebase origin/detsig
+ [[ 1 -ne 0 ]]
+ echo 'Rebase failed for detsig'
Rebase failed for detsig
+ ret_code=1
+ continue
+ for branch in '$(git branch -vv | grep -v ": gone]" | awk '\''{print $1}'\'')'
+ '[' -e ecies ']'
+ echo 'Merging ecies'
Merging ecies
+ git checkout ecies
+ [[ 0 -ne 0 ]]
+ git rebase origin/ecies
+ [[ 1 -ne 0 ]]
+ echo 'Rebase failed for ecies'
Rebase failed for ecies
+ ret_code=1
+ continue
+ for branch in '$(git branch -vv | grep -v ": gone]" | awk '\''{print $1}'\'')'
+ '[' -e hmqv ']'
+ echo 'Merging hmqv'
Merging hmqv
+ git checkout hmqv
+ [[ 0 -ne 0 ]]
+ git rebase origin/hmqv
+ [[ 1 -ne 0 ]]
+ echo 'Rebase failed for hmqv'
Rebase failed for hmqv
+ ret_code=1
+ continue

これgit-rebaseマニュアルページ戻りコードは議論されていないので、それが何を意味するのかわかりません。また、このコマンドが返すことができる他の値が何であるかわかりません。

git-rebase戻りコード1はどういう意味ですか?git-rebaseテストを軽減するために、「ハードエラー」と「ソフトエラー」の戻りコードはありますか0


$ git --version
git version 1.8.5.2 (Apple Git-48)

$ cat master-merge.sh 
#!/usr/bin/env bash

# make sure this is a Git directory
if [[ (-z $(git rev-parse HEAD 2>/dev/null)) ]]; then
    echo "$PWD is not a Git repository"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 2 || return 2
fi

ret_code=0
current=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)

git fetch --all &>/dev/null
if [[ ("$?" -eq "0") ]]; then
    for branch in $(git branch -vv | grep -v ": gone]" | awk '{print $1}'); do

        # For some reason, this picks up all files
        if [ -e "$branch" ]; then
            continue
        fi

        echo "Merging $branch"

        git checkout "$branch" &>/dev/null
        if [[ ("$?" -ne "0") ]]; then
            echo "Checkout failed for $branch"
            ret_code=1
            continue
        fi

        git rebase "origin/$branch" &>/dev/null
        if [[ ("$?" -ne "0") ]]; then
            echo "Rebase failed for $branch"
            ret_code=1
            continue
        fi

        git merge master -m "Merge 'master' into '$branch'"
        if [[ ("$?" -ne "0") ]]; then
            echo "Merge failed for $branch"
            ret_code=1
            continue
        fi

        git push
        if [[ ("$?" -ne "0") ]]; then
            echo "Push failed for $branch"
            ret_code=1
            continue
        fi
    done    
fi

if [[ (! -z "$current") ]]; then
    echo "Switching to $current"
    git checkout "$current" &>/dev/null
fi

[[ "$0" = "$BASH_SOURCE" ]] && exit "$ret_code" || return "$ret_code"

ベストアンサー1

おすすめ記事