Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [maintainer-tools PATCH] dim: turn commit-add-tag into a proper dim subcommand
Date: Mon, 21 Mar 2016 12:07:08 +0200	[thread overview]
Message-ID: <87r3f4ta9f.fsf@intel.com> (raw)
In-Reply-To: <20160321091751.GF28483@phenom.ffwll.local>

On Mon, 21 Mar 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> [ text/plain ]
> On Thu, Mar 17, 2016 at 11:15:29AM +0200, Jani Nikula wrote:
>> This lets you add e.g. review tags to a commit on the command line:
>> 
>> $ dim commit-add-tag "Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>"
>> 
>> This could be used as a building block for further scripting.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Is the grand plan to add this to dim apply-resolved too? Just realized
> again that we don't yet add them ...

I didn't really have a grand plan, and I've never used apply-resolved...

Anyway, it's kind of tricky because at that point we've already lost the
message-id.

BR,
Jani.

>
> Ack.
> -Daniel
>
>> ---
>>  dim | 19 ++++++++++---------
>>  1 file changed, 10 insertions(+), 9 deletions(-)
>> 
>> diff --git a/dim b/dim
>> index 9c8ae1098977..eda79017be94 100755
>> --- a/dim
>> +++ b/dim
>> @@ -183,15 +183,16 @@ if message_id is not None:
>>  EOF
>>  }
>>  
>> -# append a new tag at the end of the commit message of HEAD
>> -# $1 = tag, $2 = value
>> -commit_add_tag ()
>> +# append all arguments as tags at the end of the commit message of HEAD
>> +function dim_commit_add_tag
>>  {
>> -	# the first sed deletes all trailing blank lines at the end
>> -	git log -1 --pretty=%B | \
>> -		sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | \
>> -		sed "\$a$1: $2" | \
>> -		git commit --amend -F-
>> +	for arg; do
>> +		# the first sed deletes all trailing blank lines at the end
>> +		git log -1 --pretty=%B | \
>> +			sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | \
>> +			sed "\$a${arg}" | \
>> +			git commit --amend -F-
>> +	done
>>  }
>>  
>>  function update_linux_next
>> @@ -427,7 +428,7 @@ function dim_apply_branch
>>  	cat $file | git am -3 $sob "$@"
>>  
>>  	if [ -n "$message_id" ]; then
>> -		commit_add_tag "Link" "http://patchwork.freedesktop.org/patch/msgid/$message_id"
>> +		dim_commit_add_tag "Link: http://patchwork.freedesktop.org/patch/msgid/$message_id"
>>  	else
>>  		echo "No message-id found in the patch file."
>>  	fi
>> -- 
>> 2.1.4
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2016-03-21 10:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17  9:15 [maintainer-tools PATCH] dim: turn commit-add-tag into a proper dim subcommand Jani Nikula
2016-03-21  9:17 ` Daniel Vetter
2016-03-21 10:07   ` Jani Nikula [this message]

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=87r3f4ta9f.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /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