I wanted to avoid the mutt bit, and dump it to a file so I can
scp it to somewhere else.
---
 dim | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/dim b/dim
index e477d043458b..c2d377dd9694 100755
--- a/dim
+++ b/dim
@@ -1896,6 +1896,9 @@ function dim_pull_request
                repo="drm-intel"
        else
                tag=$(tag_name "$branch")
+               if [[ $NOMAIL ]] ; then
+                       req_file=$tag.txt
+               fi
                gitk --first-parent "$branch" ^$upstream &
                tag_branch $tag $branch
                $DRY git push $remote $tag
@@ -1908,8 +1911,12 @@ function dim_pull_request
        git_url=$(pick_protocol_url git $url_list)
 
        git request-pull $upstream $git_url $tag >> $req_file
-       $DRY $DIM_MUA -s "[PULL] $branch" \
-            -i $req_file "${dim_pull_request_recipients[@]}"
+       if [[ $NOMAIL ]] ; then
+               echo "pull request written to $req_file";
+       else
+               $DRY $DIM_MUA -s "[PULL] $branch" \
+                    -i $req_file "${dim_pull_request_recipients[@]}"
+       fi
 }
 
 function dim_pull_request_next
@@ -2319,8 +2326,9 @@ INTERACTIVE=
 DRY=
 FORCE=
 HELP=
+NOMAIL=
 
-while getopts hdfis opt; do
+while getopts ohdfis opt; do
        case "$opt" in
                d)
                        DRY_RUN=--dry-run
@@ -2335,6 +2343,9 @@ while getopts hdfis opt; do
                h)
                        HELP=1
                        ;;
+               o)
+                       NOMAIL=1
+                       ;;
                s)
                        # FIXME: transitional, do unconditionally at the top
                        # when there are no more errors about unbound variables
-- 
2.17.1

_______________________________________________
dim-tools mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dim-tools

Reply via email to