Print a message when diffing huge files (git-p4)

Review Request #12256 — Created April 25, 2022 and discarded

Information

RBTools
master

Reviewers

In order to create diffs that work with the perforce server, when
posting from a git-p4 repo, we have to in effect linewise process the
diff output from git diff. For very large files this can take quite a
while and users can be confused as to what is going on.

The solution is to print something to the standard output when diffing a
very large file and update it with a bit of progress every 1000 lines.

in a git repo with extremely large text files, rbt post. See that the output 'Creating diff for large file...' is printed and a little spinner animation updated every 1000 lines.

Summary ID
Print a message when diffing huge files (git-p4)
In order to create diffs that work with the perforce server, when posting from a git-p4 repo, we have to in effect linewise process the diff output from git diff. For very large files this can take quite a while and users can be confused as to what is going on. The solution is to print something to the standard output when diffing a very large file and update it with a bit of progress every 1000 lines.
06921eb19a0f937699f0058a23d1e017e88c5800
Description From Last Updated

We're trying to move away from a model where SCMClients, or really anything but command code, generates non-logging output or …

chipx86chipx86

E201 whitespace after '('

reviewbotreviewbot

E202 whitespace before ')'

reviewbotreviewbot

E225 missing whitespace around operator

reviewbotreviewbot

E201 whitespace after '['

reviewbotreviewbot

E202 whitespace before ']'

reviewbotreviewbot

E201 whitespace after '['

reviewbotreviewbot

E201 whitespace after '('

reviewbotreviewbot

E201 whitespace after '('

reviewbotreviewbot

E202 whitespace before ')'

reviewbotreviewbot

E202 whitespace before ')'

reviewbotreviewbot

E202 whitespace before ']'

reviewbotreviewbot

E202 whitespace before ')'

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

puremourning
chipx86
  1. 
      
  2. Show all issues

    We're trying to move away from a model where SCMClients, or really anything but command code, generates non-logging output or otherwise assumes anything about the environment in which it's being run. We therefore can't put progress information here.

    Plus, this probably breaks rbt diff, which will get the progress info in the output.

    What I'd suggest instead is introducing a spinner or something in rbt post for diff generation.

    A larger change could involve some optional progress callback during diff generation that could supply the number of total files and generated files, and to use that to construct a progress bar (similar to those used for diff validation/upload), but a basic spinner should be fine.

    1. Sure. I thought this might be at least mildly contentious. I'll drop it. Thanks for taking a look.

  3. 
      
puremourning
Review request changed
Status:
Discarded