#!/bin/bash # # Does a batch send using git-format-patch and git-send-email. I like to # have an intro message with all patches sent as replies to the intro msg. # In a threaded mail reader, it would look like: # # Intro message about patches # [PATCH] patch 1 # [PATCH] patch 2 # [PATCH] patch 3 # .... # # By default, git-send-email sends each patch as a reply to the previous, so # you get a nasty stairstep thing and no intro text. It looks like this: # # [PATCH] patch 1 # [PATCH] patch 2 # [PATCH] patch 3 # .... # # Copyright (C) 2008 Red Hat, Inc. # Author: David Cantrell # License: GPLv2+ # CWD="$(pwd)" usage() { echo "Usage: $(basename ${0}) [recipient email addr]" } dest="${1}" if [ -z "${dest}" ]; then usage exit 1 fi echo "${dest}" | grep -q '@' if [ $? -eq 1 ]; then usage exit 2 fi if [ ! -f "${CWD}/_msg" ]; then echo "Missing intro message, please run git-msg-template first." exit 3 fi git-format-patch origin git-send-email --no-chain-reply-to --quiet --to ${dest} _msg *.patch