Skip to content

Fix progress - #2608

Merged
technoweenie merged 3 commits into
masterfrom
fix-progress
Sep 26, 2017
Merged

technoweenie merged 3 commits into
masterfrom
fix-progress

Conversation

@technoweenie

Copy link
Copy Markdown
Contributor

Fixes 3 issues with GIT_LFS_PROGRESS:

  1. It's reported twice for lfs pull or lfs clone, since (*ProgressMeter) StartTransfer(string) is called in the GitScanner before being added to the transfer queue AND in the transfer queue. GIT_LFS_PROGRESS's <current>/<total files> is wrong #2599
  2. The checkout never knows how many files there are, so the progress is reported as 1/1, 2/2, 3/3, etc.
  3. No tests :(

I'm not crazy about changing checkout to accumulate a []*WrappedPointer slice, but it's the only way to know the total number of files to checkout before starting to check files out.

@technoweenie
technoweenie merged commit 385b564 into master Sep 26, 2017
@technoweenie
technoweenie deleted the fix-progress branch September 26, 2017 16:35
chrisd8088 added a commit that referenced this pull request Aug 5, 2026
In commit e8325a9 of PR #2608 we added
the original version of our "t/t-progress.sh" shell test script with
a single test named "GIT_LFS_PROGRESS".  This test remains the only
one in the script, and is intended to verify that the Git LFS client
writes progress log messages into the file specified with the
GIT_LFS_PROGRESS environment variable.

At present, the test creates a repository whose name is derived
solely from the name of the script.  In a subsequent commit in this PR
we expect to add additional tests to the "t/t-progress.sh" script,
and so we now revise the initial test to name its repository from
a local variable with a fixed value.  We also change the name of
the test to more clearly identify its purpose and to align its
name with that of its test repository.

The Git LFS client requires that the GIT_LFS_PROGRESS environment
variable contain an absolute file path before the client will
write any progress log messages to the file.  The test therefore
sets the environment variable with an absolute path to a file named
"progress.log" in the directory specified by the TRASHDIR shell
variable.  This directory is created during the initialization of
each shell test script and is unique to the script.

However, since we intend to add new tests to the "t/t-progress.sh"
script, if we use the same file path for the GIT_LFS_PROGRESS
environment variable in each test, we will need all the tests
which follow the initial one to begin by removing the file, or
else the tests may pass because they unintentionally match lines
in the log created by previous tests.

We therefore rewrite the initial test to create a series of
unique progress log files in a directory unique to the test,
whose path we construct using the TRASHDIR variable plus the
name of the test's repository.

As well, we expand the test so that it now verifies all of the
types of progress log messages output by the Git LFS client,
including for both "clean" filter operations and "upload" object
transfers.  Note that "clean" filter operations are logged separately
for each object, so we always find "1/1" fields in these messages
(i.e., "one file of one total file"), whereas our other messages
report "1/n" fields where "n" is the total number of objects being
downloaded or uploaded.

We also take the opportunity to insert clarifying whitespace to the
test, add a check that the "git push" command returned an exit code
of zero to indicate success, and change the name of the directory
into which the test clones its primary repository to follow our
current idiom, in which we append the suffix "-assert" to the name
of the source repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant