Skip to contentSkip to conversation

dim: Try git-merge --ff-only before git-rebase -i when updating branches.

PATCH Superseded Maarten Lankhorst 2 participants 4 messages Dec 6, 2016 – Dec 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dim: Try git-merge --ff-only before git-rebase -i when updating branches.

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.

---
 dim | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
dim +1 -3
index fa63ae8c8a79..b2e6841e23d7 100755
@@ -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
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 14 lines · Maarten Lankhorst

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.

---
 dim | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
dim +0 -0
index fa63ae8c8a79..b2e6841e23d7 100755

dim function dim_update_branches · line 1289

Quoted 7 lines
dim +1 -3
@@ -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.

Quoted 3 lines
dim +0 -0
 			$DRY git rebase -i
 		fi
 	done
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v2 1/1 dim: Try git-merge --ff-only before git-rebase -i when updating branches.

Op 07-12-16 om 10:33 schreef Jani Nikula:

Quoted 18 lines · Maarten Lankhorst
Quoted 17 lines

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.

---
 dim | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
dim +0 -0
index fa63ae8c8a79..b2e6841e23d7 100755
@@ -1286,9 +1286,7 @@ function dim_update_branches
 		repo=`branch_to_repo $branch`
 		remote=`repo_to_remote $repo`
 
Quoted 8 lines

dim function dim_update_branches · line 1289

Quoted 4 lines
dim +1 -3
-		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.

---

dim +1 -3
index fa63ae8c8a79..e0551ace54e4 100755
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 26 lines · Maarten Lankhorst

Op 07-12-16 om 10:33 schreef Jani Nikula:

Quoted 25 lines · Maarten Lankhorst
Quoted 14 lines

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.

---
 dim | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
dim +0 -0
index fa63ae8c8a79..b2e6841e23d7 100755

dim function dim_update_branches · line 1289

Quoted 7 lines
dim +1 -3
@@ -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?

Quoted 7 lines
Quoted 1 line

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.

Quoted 19 lines

---

dim +1 -3
index fa63ae8c8a79..e0551ace54e4 100755
@@ -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
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx