Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show upload progress #317

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Show upload progress #317

wants to merge 3 commits into from

Conversation

smeeckaert
Copy link

Hi,

I've came across the same issue as #167, namely sometime it looks like there is no activity when you upload a large number of files.

The progress is only shown in the non-verbose mode, in verbose curl does its thing as before.

So I've changed the fire_upload_buffer method to display a progress, it looks like that :

Uploading 144 files...
Progress: 140/144
Uploading 144 files...
Progress: 144/144 (Done)

I'm not a tremendous bash developer so tell me if it's interesting for you or if you see any changes to make.

@mkllnk
Copy link
Member

mkllnk commented Jan 17, 2017

Cool. Thank you for your contribution. I will review your code as soon as I have some time.

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. This is a great move into the right direction. People were asking for more feedback for ages. And this approach will be useful for parsing error messages as well. Do you think you could extends your pull request to that?

And can you write a test case to proof that it's working?

print_info "Uploading ..."
local BUFFERED_ITEMS="$1"
print_info "Uploading $BUFFERED_ITEMS files..."
REMOTE_CMD_OPTIONS=""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would remove other options like --key and --pubkey as well.

UPLOADED=$(($UPLOADED+1))
echo -ne "\rProgress: $UPLOADED/$BUFFERED_ITEMS"
done
echo -ne " (Done)\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just echo " (Done)"?

print_progress() {
local BUFFERED_ITEMS="$1"
local UPLOADED=0
while IFS= read -r line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just take each line as the output of a successful progress. What if there are error messages in between? For example when it can't upload one file, curl will print an error and then continue. Would that confuse your counting?

@muuvmuuv
Copy link

muuvmuuv commented May 7, 2017

Hi @smeeckaert. Did you made any changes here? It would be so nice to have that feature!

@mkllnk mkllnk mentioned this pull request Jul 7, 2017
@MarcelWeidum
Copy link

This would be awesome.

@davordragic
Copy link

it's 5 years and nothing updated.

@jonas-
Copy link

jonas- commented Dec 22, 2023

yes, this (and other pull requests) would be great. Is anybody still maintaining git-ftp?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants