All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 4/6] dim: Add git_is_current_branch helper
Date: Thu, 26 Jan 2017 12:43:34 +0200	[thread overview]
Message-ID: <877f5i3xux.fsf@intel.com> (raw)
In-Reply-To: <20170126091049.9122-4-daniel.vetter@ffwll.ch>

On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> And use it everywhere. Found a few more places that don't use the
> usual style.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  dim | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/dim b/dim
> index cf61dc412652..73fb32c4d5ab 100755
> --- a/dim
> +++ b/dim
> @@ -302,6 +302,11 @@ function git_fetch_helper # remote
>  	fi
>  }
>  
> +function git_is_current_branch # branch
> +{
> +	git branch --list $1 | grep -q '\*'

This could be made even stricter, but LGTM. And now further improvements
can be made in this function.

BR,
Jani.

> +}
> +
>  if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
>          dim_uptodate
>  fi
> @@ -439,7 +444,7 @@ function dim_rebuild_tip
>  	echo "Done."
>  
>  	cd $DIM_PREFIX/$integration_branch
> -	if ! git branch --list $integration_branch | grep -q '\*' ; then
> +	if ! git_is_current_branch $integration_branch ; then
>  		echo "Branch setup for the integration repo is borked"
>  		exit 1
>  	fi
> @@ -517,7 +522,7 @@ function dim_rebuild_tip
>  
>  	echo -n "Updating rerere cache... "
>  	cd $rerere
> -	if git branch --list rerere-cache | grep -q '\*' ; then
> +	if git_is_current_branch rerere-cache ; then
>  		remote=`branch_to_remote rerere-cache`
>  
>  		git pull >& /dev/null
> @@ -1310,7 +1315,7 @@ function dim_update_branches
>  	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
>  
>  	cd $DIM_PREFIX/maintainer-tools
> -	if git branch | grep maintainer-tools | grep '\*' ; then
> +	if git_is_current_branch maintainer-tools ; then
>  		echo "Updating maintainer-tools ..."
>  		git pull --rebase
>  	fi
> @@ -1425,7 +1430,7 @@ function assert_branch
>  
>  	dim_cd $branch
>  
> -	if git branch | grep $branch | grep '\*' ; then
> +	if git_is_current_branch $branch ; then
>  		return 0
>  	else
>  		echo "You're on the wrong branch, expected $branch in $PWD"

-- 
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:[~2017-01-26 10:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
2017-01-26  9:10 ` [PATCH 2/6] dim: don't check everything in dim setup Daniel Vetter
2017-01-26  9:10 ` [PATCH 3/6] dim: Also allow git urls Daniel Vetter
2017-01-26 10:39   ` Jani Nikula
2017-01-26  9:10 ` [PATCH 4/6] dim: Add git_is_current_branch helper Daniel Vetter
2017-01-26 10:43   ` Jani Nikula [this message]
2017-01-26  9:10 ` [PATCH 5/6] dim: Add helper for checking for a branch Daniel Vetter
2017-01-26 10:46   ` Jani Nikula
2017-01-26  9:10 ` [PATCH 6/6] dim: Don't try to create branches in update_branches Daniel Vetter
2017-01-26 10:47   ` Jani Nikula
2017-01-26 10:42 ` [PATCH] dim: Explain how to resolve conflicts when git rerere fails Daniel Vetter
2017-01-26 11:12 ` [PATCH 1/6] dim: Update docs Jani Nikula

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=877f5i3xux.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --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 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.