public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] Formal acks and patchwork
Date: Mon, 23 May 2011 22:15:21 +0200	[thread overview]
Message-ID: <4DDAC059.5020301@aribaud.net> (raw)
In-Reply-To: <20110523194216.F2D411499BF9@gemini.denx.de>

Le 23/05/2011 21:42, Wolfgang Denk a ?crit :
> Dear Albert ARIBAUD,
>
> In message<4DDAB341.20006@aribaud.net>  you wrote:
>>
>>> For example, instead of applying a patch directly from my mailbox I
>>> use this file only to get the hash value for the PW entry, and then
>>> use pwclient to apply it and to update it's state:
>>>
>>>           HASH=$(pwparser.py --hash<$PATCH)
>>>           if [ -z "$HASH" ]
>>>           then
>>>                   echo "ERROR: $PATCH - no such entry in PatchWork">&2
>>>                   exit 1
>>>           fi
>>>
>>>           if pwclient apply -h $HASH
>>>           then
>>>                   pwclient update -s 'Accepted' -h $HASH
>>>           fi
>>>
>>> This is extremely convenient as it automatically takes care of both
>>> the Acks and the state change.
>>
>> Thanks. Looks like this could be handy for many others. Maybe it should
>> be 'backported' into pwclient itself as a new command.
>
> Note that there is a caveat of this approach.  Or call it bug in PW.
> We frequently see patch series, which get posted in several versions.
> Quite often not all patches are changed, so it happens that for
> example patch 3/8 is the same in all versions 2, 3 and 4 of the patch
> series.  That means all versions of this patch have the same hash.
> Usually I apply the latest version, and want to change the status of
> this one, but the 'pwclient -h $HASH' will always reference the
> _oldest_ version of the patch.  So watchout when you see it changing
> the state from "superseded" to "applied" - usually this means it
> changed the wrong version.  [I reported this on the PW ML, but no
> response yet.]
>
> I should mention that I have hacked pwclient a bit to use "git am"
> instead of plain "patch", and to report the status change:
>
> @@ -110,7 +110,7 @@
>                           (os.path.basename(sys.argv[0])))
>       sys.stderr.write("Where<action>  is one of:\n")
>       sys.stderr.write(
> -"""        apply<ID>     : Apply a patch (in the current dir, using -p1)
> +"""        apply<ID>     : Apply a patch (using 'git-am -3 -u --whitespace=strip')
>           get<ID>       : Download a patch and save it locally
>           projects      : List all projects
>           states        : Show list of potential patch states
> @@ -260,7 +260,7 @@
>       print "Description: %s" % patch['name']
>       s = rpc.patch_get_mbox(patch_id)
>       if len(s)>  0:
> -        proc = subprocess.Popen(['patch', '-p1'], stdin = subprocess.PIPE)
> +        proc = subprocess.Popen(['git', 'am', '-3', '-u', '--whitespace=strip'], stdin = subprocess.PIPE)
>           proc.communicate(s)
>       else:
>           sys.stderr.write("Error: No patch content found\n")
> @@ -280,6 +280,8 @@
>           if state_id == 0:
>               sys.stderr.write("Error: No State found matching %s*\n" % state)
>               sys.exit(1)
> +       old_id = patch['state']
> +        sys.stderr.write("## commit: %s  state: %s ==>  %s\n" % (commit, old_id, state))
>           params['state'] = state_id
>
>       if commit:

I personally only added a "pwclient am" command to do a git am, the same 
way as "pwclient apply" does a git apply.

> Best regards,
>
> Wolfgang Denk

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-05-23 20:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 11:54 [U-Boot] [PATCH] [Timer]Remove calls to [get, reset]_timer outside arch/ Graeme Russ
2011-05-23 12:19 ` Scott McNutt
2011-05-23 12:32   ` Graeme Russ
2011-05-23 13:12     ` Scott McNutt
     [not found]       ` <4DDA9CDA.1080401@comcast.net>
     [not found]         ` <4DDAA77F.7020708@psyent.com>
2011-05-23 20:10           ` Graeme Russ
2011-05-23 20:49             ` J. William Campbell
2011-05-23 21:02               ` Graeme Russ
2011-05-23 21:15                 ` J. William Campbell
2011-05-24  5:13                 ` Graeme Russ
2011-05-24 15:41                   ` J. William Campbell
2011-05-23 21:53               ` Wolfgang Denk
2011-05-23 22:44                 ` Graeme Russ
2011-05-24  3:20                   ` Mike Frysinger
2011-05-23 12:31 ` Jens Scharsig
2011-05-23 13:22   ` Wolfgang Denk
2011-05-23 14:05     ` [U-Boot] Formal acks and patchwork (was: [PATCH] [Timer]Remove calls to [get, reset]_timer outside arch/) Albert ARIBAUD
2011-05-23 18:44       ` Wolfgang Denk
2011-05-23 19:19         ` [U-Boot] Formal acks and patchwork Albert ARIBAUD
2011-05-23 19:42           ` Wolfgang Denk
2011-05-23 20:15             ` Albert ARIBAUD [this message]
2011-05-23 13:34 ` [U-Boot] [PATCH] [Timer]Remove calls to [get, reset]_timer outside arch/ Jens Scharsig
     [not found] ` <BANLkTik3W7WJbRuiKsC8m0f8iof7JL-ZMg@mail.gmail.com>
2011-05-23 20:09   ` Graeme Russ
2011-05-24 10:54 ` Graeme Russ
2011-05-24 11:13   ` Graeme Russ
2011-05-25 12:17   ` Graeme Russ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDAC059.5020301@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox