All of lore.kernel.org
 help / color / mirror / Atom feed
* [maintainer-tools PATCH 1/2] dim: use quotes when testing for empty string
@ 2015-12-03 19:40 Paulo Zanoni
  2015-12-03 19:40 ` [maintainer-tools PATCH 2/2] dim: add a QUICKSTART section to dim.rst Paulo Zanoni
  2015-12-04  8:35 ` [maintainer-tools PATCH 1/2] dim: use quotes when testing for empty string Jani Nikula
  0 siblings, 2 replies; 5+ messages in thread
From: Paulo Zanoni @ 2015-12-03 19:40 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula

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 <jani.nikula@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 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
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-07 13:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 19:40 [maintainer-tools PATCH 1/2] dim: use quotes when testing for empty string Paulo Zanoni
2015-12-03 19:40 ` [maintainer-tools PATCH 2/2] dim: add a QUICKSTART section to dim.rst Paulo Zanoni
2015-12-04  8:40   ` Jani Nikula
2015-12-07 13:32     ` Zanoni, Paulo R
2015-12-04  8:35 ` [maintainer-tools PATCH 1/2] dim: use quotes when testing for empty string Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.