public inbox for intel-gfx@lists.freedesktop.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 6/6] dim: add command to check for dim updates
Date: Tue, 11 Oct 2016 16:07:30 +0300	[thread overview]
Message-ID: <87d1j7yqy5.fsf@intel.com> (raw)
In-Reply-To: <20161011130040.GB20761@phenom.ffwll.local>

On Tue, 11 Oct 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Tue, Oct 11, 2016 at 11:47:32AM +0300, Jani Nikula wrote:
>> Add a command to check if the user is running an up-to-date version of
>> dim.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  dim     | 21 +++++++++++++++++++++
>>  dim.rst |  4 ++++
>>  2 files changed, 25 insertions(+)
>> 
>> diff --git a/dim b/dim
>> index bef7bb6c401b..5fb3a0fee7ff 100755
>> --- a/dim
>> +++ b/dim
>> @@ -179,6 +179,27 @@ if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "us
>>  		xargs -n 1 echo | grep '^origin' | sed -e 's/^origin\///'`
>>  fi
>>  
>> +function dim_uptodate
>> +{
>> +	local using="${BASH_SOURCE[0]}"
>> +
>> +	if [[ ! -e "$using" ]]; then
>> +		echo "$dim: could not figure out the version being used ($using)." >&2
>> +		exit 1
>> +	fi
>> +
>> +	if [[ ! -e "$DIM_PREFIX/maintainer-tools/.git" ]]; then
>> +		echo "$dim: could not find the upstream repo for $dim." >&2
>> +		exit 1
>> +	fi
>> +
>> +	if ! git --git-dir=$DIM_PREFIX/maintainer-tools/.git show origin/maintainer-tools:dim |\
>> +			diff "$using" - >& /dev/null; then
>> +		echo "$dim: not running upstream version of the script." >&2
>> +		exit 1
>> +	fi
>> +}
>
> Should we run this at startup every once in a while? Something like
>
> if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
> 	dim_uptodate
> fi
>
> at the top? date-based rng tested, otherwise not ...

I had something like that in mind at first, but decided to be less
obnoxious for starters. ;)

> With or without these bikesheds Acked-by: me on the entire series.

I'll get back to the bikesheds later, pushed as-is now. Thanks.

BR,
Jani.


> -Daniel
>
>> +
>>  # get message id from file
>>  # $1 = file
>>  message_get_id ()
>> diff --git a/dim.rst b/dim.rst
>> index 7244052dea03..85de95796611 100644
>> --- a/dim.rst
>> +++ b/dim.rst
>> @@ -317,6 +317,10 @@ list-upstreams
>>  List of all upstreams commonly used for pull requests. Useful for autocompletion
>>  scripts.
>>  
>> +uptodate
>> +--------
>> +Try to check if you're running an up-to-date version of **dim**.
>> +
>>  help
>>  ----
>>  Show this help. Install **rst2man(1)** for best results.
>> -- 
>> 2.1.4
>> 

-- 
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-10-11 13:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11  8:47 [maintainer-tools PATCH 1/6] dim: refer to the script itself by basename without path Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 2/6] dim: columnize usage output if column(1) is available Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 3/6] dim: clean up the rm's in dim checker Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 4/6] dim: add DIM_MAKE_OPTIONS configuration Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 5/6] dim: add dim sparse subcommand to run sparse on a commit range Jani Nikula
2016-10-11 12:56   ` Daniel Vetter
2016-10-11  8:47 ` [maintainer-tools PATCH 6/6] dim: add command to check for dim updates Jani Nikula
2016-10-11 13:00   ` Daniel Vetter
2016-10-11 13:07     ` Jani Nikula [this message]
2016-10-13 14:50       ` Daniel Vetter

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=87d1j7yqy5.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