Today I applied/pushed patches for the first time, and noticed that
all my commits had exactly this:
    Link: http://patchwork.freedesktop.org/patch/msgid/
without the actual ID there. I assumed the ID would be set by some
commit hook since our hooks seem to be able to talk to patchwork.
Looks like I was wrong. It seems that I was supposed to apply a patch
email, not the original patch file that I sent with git send-email.

The problem happened due to missing quotes around $message_id:

    pzanoni@panetone:~/nfs/teste$ cat test.sh
    #!/bin/bash
    A=""
    if [ -n $A ]; then
        echo "No quotes: true"
    else
        echo "No quotes: false"
    fi
    if [ -n "$A" ]; then
        echo "With quotes: true"
    else
        echo "With quotes: false"
    fi
    pzanoni@panetone:~/nfs/teste$ bash test.sh
    No quotes: true
    With quotes: false

In addition, print a little message telling us that the message-ids
are missing. This may help by reminding us that we should apply the
mail file, not the original patch. I'm not enforcing it since I don't
know all our use cases.

Cc: Jani Nikula <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
---
 dim | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 78b3f30..5f2f686 100755
--- a/dim
+++ b/dim
@@ -382,8 +382,10 @@ function dim_apply
 
        cat $file | git am -3 "$@"
 
-       if [ -n $message_id ]; then
+       if [ -n "$message_id" ]; then
                commit_add_tag "Link" 
"http://patchwork.freedesktop.org/patch/msgid/$message_id";
+       else
+               echo "No message-id found in the patch file."
        fi
 
        eval $DRY $DIM_POST_APPLY_ACTION
-- 
2.6.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to