Update pib
This commit is contained in:
parent
cae3cad034
commit
152a80a387
1 changed files with 13 additions and 4 deletions
15
pib
15
pib
|
@ -13,7 +13,7 @@ REMOTE_REPO="$1"
|
||||||
commits=$(git rev-list --reverse main)
|
commits=$(git rev-list --reverse main)
|
||||||
|
|
||||||
# Set the batch size
|
# Set the batch size
|
||||||
BATCH_SIZE=1000
|
BATCH_SIZE=10000
|
||||||
|
|
||||||
# Initialize counter and range variables
|
# Initialize counter and range variables
|
||||||
start=0
|
start=0
|
||||||
|
@ -36,9 +36,18 @@ do
|
||||||
# Get the range of commits for the current batch
|
# Get the range of commits for the current batch
|
||||||
range="${commit_array[$end-1]}"
|
range="${commit_array[$end-1]}"
|
||||||
|
|
||||||
# Push the current batch
|
# Progress display before each push
|
||||||
git push $REMOTE_REPO $range:refs/heads/main -f
|
percent_complete=$((start * 100 / total_commits))
|
||||||
|
echo -ne "Pushing commits $start to $((end-1)) of $total_commits ($percent_complete%)\r"
|
||||||
|
|
||||||
|
# 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
|
# Update the start and end for the next batch
|
||||||
|
|
Loading…
Reference in a new issue