public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: [PATCH v2] dim: Try git-merge --ff-only before git-rebase -i when updating branches.
Date: Wed, 7 Dec 2016 18:12:43 +0100	[thread overview]
Message-ID: <75cfd30e-19dd-e742-5102-ca743e4b9fea@linux.intel.com> (raw)
In-Reply-To: <87h96gxev2.fsf@intel.com>

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

  reply	other threads:[~2016-12-07 17:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Maarten Lankhorst [this message]
2016-12-07 18:09     ` [PATCH v2] " 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=75cfd30e-19dd-e742-5102-ca743e4b9fea@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    /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