Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bbguimaraes
dotfiles
Commits
02aab09c
Commit
02aab09c
authored
Jun 20, 2022
by
bbguimaraes
Browse files
scripts/git: only rebase if necessary
parent
38705ba0
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/git.sh
View file @
02aab09c
...
...
@@ -139,14 +139,13 @@ rebase() {
}
rebase_branches
()
{
local
x
git switch master
local
base x
n
=
0
base
=
$(
git rev-parse HEAD
)
[[
"$#"
-eq
0
]]
&&
set
--
$(
git branch
--no-merged
)
git rebase master
"
$1
"
shift
for
x
;
do
sleep
1
# for unique timestamps
git rebase master
"
$x
"
git merge-base
--is-ancestor
"
$base
"
"
$x
"
&&
continue
sleep
"
$n
"
;
n
=
1
# for unique timestamps
git rebase
"
$base
"
"
$x
"
done
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment