Skip to content

Show upload progress#317

Open
smeeckaert wants to merge 3 commits into
git-ftp:masterfrom
smeeckaert:master
Open

Show upload progress#317
smeeckaert wants to merge 3 commits into
git-ftp:masterfrom
smeeckaert:master

Conversation

@smeeckaert

Copy link
Copy Markdown

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

mkllnk commented Jan 17, 2017

Copy link
Copy Markdown
Member

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

@mkllnk mkllnk left a comment

Copy link
Copy Markdown
Member

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?

Comment thread git-ftp
print_info "Uploading ..."
local BUFFERED_ITEMS="$1"
print_info "Uploading $BUFFERED_ITEMS files..."
REMOTE_CMD_OPTIONS=""

Copy link
Copy Markdown
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.

Comment thread git-ftp
UPLOADED=$(($UPLOADED+1))
echo -ne "\rProgress: $UPLOADED/$BUFFERED_ITEMS"
done
echo -ne " (Done)\n"

Copy link
Copy Markdown
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)"?

Comment thread git-ftp
print_progress() {
local BUFFERED_ITEMS="$1"
local UPLOADED=0
while IFS= read -r line

Copy link
Copy Markdown
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

muuvmuuv commented May 7, 2017

Copy link
Copy Markdown

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
Copy Markdown

This would be awesome.

@davordragic

Copy link
Copy Markdown

it's 5 years and nothing updated.

@jonas-

jonas- commented Dec 22, 2023

Copy link
Copy Markdown

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.

6 participants