Update pib
This commit is contained in:
parent
cae3cad034
commit
152a80a387
1 changed files with 13 additions and 4 deletions
17
pib
17
pib
|
@ -13,7 +13,7 @@ REMOTE_REPO="$1"
|
|||
commits=$(git rev-list --reverse main)
|
||||
|
||||
# Set the batch size
|
||||
BATCH_SIZE=1000
|
||||
BATCH_SIZE=10000
|
||||
|
||||
# Initialize counter and range variables
|
||||
start=0
|
||||
|
@ -35,12 +35,21 @@ do
|
|||
|
||||
# Get the range of commits for the current batch
|
||||
range="${commit_array[$end-1]}"
|
||||
|
||||
# Progress display before each push
|
||||
percent_complete=$((start * 100 / total_commits))
|
||||
echo -ne "Pushing commits $start to $((end-1)) of $total_commits ($percent_complete%)\r"
|
||||
|
||||
# Push the current batch
|
||||
git push $REMOTE_REPO $range:refs/heads/main -f
|
||||
# Redirect git push output
|
||||
git push $REMOTE_REPO $range:refs/heads/main -f > /dev/null 2>&1
|
||||
|
||||
# Check if push succeeded
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error pushing commits. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Update the start and end for the next batch
|
||||
start=$end
|
||||
end=$(($end + $BATCH_SIZE))
|
||||
|
|
Loading…
Reference in a new issue