Verbose output of feature list is potentially incorrect #187

Open
petervanderdoes opened this Issue Jan 6, 2012 · 0 comments

Comments

Projects
None yet
1 participant

The command git flow feature list -v displays the wrong output when a feature is based on a branch other than the develop branch.

The current code gets the merge-base from the develop branch, even though I could have picked a different branch as a starting point.

    for branch in $short_names; do
        local fullname=$PREFIX$branch
        local base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
        local develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
        local branch_sha=$(git rev-parse "$fullname")
        if [ "$fullname" = "$current_branch" ]; then
            printf "* "
        else
            printf "  "
        fi
        if flag verbose; then
            printf "%-${width}s" "$branch"
            if [ "$branch_sha" = "$develop_sha" ]; then
                printf "(no commits yet)"
            elif [ "$base" = "$branch_sha" ]; then
                printf "(is behind develop, may ff)"
            elif [ "$base" = "$develop_sha" ]; then
                printf "(based on latest develop)"
            else
                printf "(may be rebased)"
            fi
        else
            printf "%s" "$branch"
        fi
        echo
    done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment