From: Matthew Ogilvie Date: Sat, 07 Dec 2013 18:21:23 GMT Subject: [PATCH 2/4] subtree: allow --squash and --message with push Message-ID: <1386440485-3092-2-git-send-email-mmogilvi_git@miniinfo.net> In-Reply-To: <1386440485-3092-1-git-send-email-mmogilvi_git@miniinfo.net> Signed-off-by: Matthew Ogilvie --- contrib/subtree/git-subtree.sh | 8 +++++++- contrib/subtree/git-subtree.txt | 9 --------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 998a9c5..56d915f 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -743,11 +743,17 @@ cmd_push() if [ $# -ne 2 ]; then die "You must provide " fi + + opts= + if [ -n "$squash" ]; then + opts="-squash" + fi + if [ -e "$dir" ]; then repository=$1 refspec=$2 echo "git push using: " $repository $refspec - localrev=$(git subtree split --prefix="$prefix") || die + localrev=$(git subtree split --prefix="$prefix" $opts --message="$message") || die git push $repository $localrev:refs/heads/$refspec else die "'$dir' must already exist. Try 'git subtree add'." diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt index 92e7a4d..03092bc 100644 --- a/contrib/subtree/git-subtree.txt +++ b/contrib/subtree/git-subtree.txt @@ -140,20 +140,11 @@ OPTIONS want to manipulate. This option is mandatory for all commands. - -OPTIONS FOR add, merge, pull, rejoin ----------------------------------- -m :: --message=:: - This option is only valid for add, merge, pull, and - split '--rejoin'. - Specify as the commit message for the merge commit. --squash:: - This option is only valid for add, merge, pull, and - split '--rejoin'. - Instead of merging the entire history from the subtree project, produce only a single commit that contains all the differences you want to merge, and then merge that -- 1.8.3.2