On 2018-Jul-02, Stephen Frost wrote:

> > * Do a dry run before really pushing by using --dry-run.
> 
> In addition to this, I'd recommend using 'git show' on the results of
> the --dry-run, so that you see what you're really about to push.

Since commit 653530c8b196 I use this little script I borrowed from Magnus, then
page through all of it before pushing.

git push --dry-run 2>&1 | grep -v '^To' | while read line; do
    if [ "$line" == "Everything up-to-date" ]; then
        echo $line
    else
        topush=$(echo $line | awk '{print $1}')
        git log --format=oneline $topush | cat
        git show --format=fuller --color $topush | cat
    fi
done | less -R

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Reply via email to