public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] dim: Try git-merge --ff-only before git-rebase -i when updating branches.
@ 2016-12-06  9:48 Maarten Lankhorst
  2016-12-07  9:33 ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Maarten Lankhorst @ 2016-12-06  9:48 UTC (permalink / raw)
  To: intel-gfx

When a branch can be fast-forwarded, try it first before rebasing.
This will prevent a whole lot of editor windows opening with 'noop'
when running dim ub.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 dim | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dim b/dim
index fa63ae8c8a79..b2e6841e23d7 100755
--- a/dim
+++ b/dim
@@ -1286,9 +1286,7 @@ function dim_update_branches
 		repo=`branch_to_repo $branch`
 		remote=`repo_to_remote $repo`
 
-		if git diff --quiet $remote/$branch; then
-			$DRY git rebase
-		else
+		if ! $DRY git merge --ff-only ; then
 			$DRY git rebase -i
 		fi
 	done
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] dim: Try git-merge --ff-only before git-rebase -i when updating branches.
  2016-12-06  9:48 [PATCH] dim: Try git-merge --ff-only before git-rebase -i when updating branches Maarten Lankhorst
@ 2016-12-07  9:33 ` Jani Nikula
  2016-12-07 17:12   ` [PATCH v2] " Maarten Lankhorst
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2016-12-07  9:33 UTC (permalink / raw)
  To: Maarten Lankhorst, intel-gfx

On Tue, 06 Dec 2016, Maarten Lankhorst <maarten.lankhorst@linux.intel.com> wrote:
> When a branch can be fast-forwarded, try it first before rebasing.
> This will prevent a whole lot of editor windows opening with 'noop'
> when running dim ub.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  dim | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/dim b/dim
> index fa63ae8c8a79..b2e6841e23d7 100755
> --- a/dim
> +++ b/dim
> @@ -1286,9 +1286,7 @@ function dim_update_branches
>  		repo=`branch_to_repo $branch`
>  		remote=`repo_to_remote $repo`
>  
> -		if git diff --quiet $remote/$branch; then
> -			$DRY git rebase
> -		else
> +		if ! $DRY git merge --ff-only ; then

What does it assume for branches to merge when none are provided? Would
it be better to be explicit?

Thanks for this, I've been meaning to do this forever...

BR,
Jani.

>  			$DRY git rebase -i
>  		fi
>  	done

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

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

* [PATCH v2] dim: Try git-merge --ff-only before git-rebase -i when updating branches.
  2016-12-07  9:33 ` Jani Nikula
@ 2016-12-07 17:12   ` Maarten Lankhorst
  2016-12-07 18:09     ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Maarten Lankhorst @ 2016-12-07 17:12 UTC (permalink / raw)
  To: Jani Nikula, intel-gfx

Op 07-12-16 om 10:33 schreef Jani Nikula:
> On Tue, 06 Dec 2016, Maarten Lankhorst <maarten.lankhorst@linux.intel.com> wrote:
>> When a branch can be fast-forwarded, try it first before rebasing.
>> This will prevent a whole lot of editor windows opening with 'noop'
>> when running dim ub.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>>  dim | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/dim b/dim
>> index fa63ae8c8a79..b2e6841e23d7 100755
>> --- a/dim
>> +++ b/dim
>> @@ -1286,9 +1286,7 @@ function dim_update_branches
>>  		repo=`branch_to_repo $branch`
>>  		remote=`repo_to_remote $repo`
>>  
>> -		if git diff --quiet $remote/$branch; then
>> -			$DRY git rebase
>> -		else
>> +		if ! $DRY git merge --ff-only ; then
> What does it assume for branches to merge when none are provided? Would
> it be better to be explicit?
>
> Thanks for this, I've been meaning to do this forever...

Hm I guess explicit might be better, what about this?
------8<-------
When a branch can be fast-forwarded, try it first before rebasing.
This will prevent a whole lot of editor windows opening with 'noop'
when running dim ub.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
diff --git a/dim b/dim
index fa63ae8c8a79..e0551ace54e4 100755
--- a/dim
+++ b/dim
@@ -1286,9 +1286,7 @@ function dim_update_branches
 		repo=`branch_to_repo $branch`
 		remote=`repo_to_remote $repo`
 
-		if git diff --quiet $remote/$branch; then
-			$DRY git rebase
-		else
+		if ! $DRY git merge --ff-only $remote/$branch; then
 			$DRY git rebase -i
 		fi
 	done

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] dim: Try git-merge --ff-only before git-rebase -i when updating branches.
  2016-12-07 17:12   ` [PATCH v2] " Maarten Lankhorst
@ 2016-12-07 18:09     ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2016-12-07 18:09 UTC (permalink / raw)
  To: Maarten Lankhorst, intel-gfx

On Wed, 07 Dec 2016, Maarten Lankhorst <maarten.lankhorst@linux.intel.com> wrote:
> Op 07-12-16 om 10:33 schreef Jani Nikula:
>> On Tue, 06 Dec 2016, Maarten Lankhorst <maarten.lankhorst@linux.intel.com> wrote:
>>> When a branch can be fast-forwarded, try it first before rebasing.
>>> This will prevent a whole lot of editor windows opening with 'noop'
>>> when running dim ub.
>>>
>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>> ---
>>>  dim | 4 +---
>>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/dim b/dim
>>> index fa63ae8c8a79..b2e6841e23d7 100755
>>> --- a/dim
>>> +++ b/dim
>>> @@ -1286,9 +1286,7 @@ function dim_update_branches
>>>  		repo=`branch_to_repo $branch`
>>>  		remote=`repo_to_remote $repo`
>>>  
>>> -		if git diff --quiet $remote/$branch; then
>>> -			$DRY git rebase
>>> -		else
>>> +		if ! $DRY git merge --ff-only ; then
>> What does it assume for branches to merge when none are provided? Would
>> it be better to be explicit?
>>
>> Thanks for this, I've been meaning to do this forever...
>
> Hm I guess explicit might be better, what about this?
> ------8<-------
> When a branch can be fast-forwarded, try it first before rebasing.
> This will prevent a whole lot of editor windows opening with 'noop'
> when running dim ub.

LGTM.

>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> diff --git a/dim b/dim
> index fa63ae8c8a79..e0551ace54e4 100755
> --- a/dim
> +++ b/dim
> @@ -1286,9 +1286,7 @@ function dim_update_branches
>  		repo=`branch_to_repo $branch`
>  		remote=`repo_to_remote $repo`
>  
> -		if git diff --quiet $remote/$branch; then
> -			$DRY git rebase
> -		else
> +		if ! $DRY git merge --ff-only $remote/$branch; then
>  			$DRY git rebase -i
>  		fi
>  	done
>

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

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

end of thread, other threads:[~2016-12-07 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06  9:48 [PATCH] dim: Try git-merge --ff-only before git-rebase -i when updating branches Maarten Lankhorst
2016-12-07  9:33 ` Jani Nikula
2016-12-07 17:12   ` [PATCH v2] " Maarten Lankhorst
2016-12-07 18:09     ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox