Add --no-i-r-s-u/--no-inc-recursive-skip-unchanged for accurate progress on resumed transfers
          #822
        
          
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Add
--no-inc-recursive-skip-unchangedfor accurate progress on resumed transfersProblem
When using
--info=progress2with--no-i-r, interrupted transfers show incorrect progress percentages after resuming. For example, if a transfer is interrupted at 20%, restarting it will show progress from 1% to 80% instead of 0% to 100%.Root cause:
stats.total_sizeincludes already-transferred unchanged files. rsync's normal operation will skip these files (they won't actually transfer), but they're already counted in the progress denominator, making the percentage calculation wrong.Solution
This PR introduces
--no-inc-recursive-skip-unchanged(with aliases--no-i-r-skip-unchangedand--no-i-r-s-u), which pre-scans destination files during generator initialization to identify unchanged files and adjustsstats.total_sizebefore progress reporting begins.Implementation
Generator-side pre-scanning:
generate_files()quick_check_ok()logic to identify unchanged filesclear_file()to exclude them from processingstats.total_sizeby subtracting unchanged file sizesInter-process communication:
MSG_FLIST_COUNTmessage to sync statistics between generator and senderstats.total_sizeUniversal compatibility:
--no-i-r(requires full file list upfront for pre-scan)Benefits
✅ Accurate progress reporting: Shows genuine 0-100% progress on resumed transfers
✅ Correct file counts:
to-chkdisplay reflects only files needing transfer✅ No significant overhead: Uses same stat operations rsync would perform anyway, just earlier in the pipeline
Testing
Naming Convention
Following rsync's established patterns (like
--no-inc-recursive/--no-i-r):--no-inc-recursive-skip-unchanged(documented in man page only)--no-i-r-skip-unchanged(hidden from--help)--no-i-r-s-u(hidden from--help)All variants function identically; only the full documentation appears in the man page, maintaining consistency with rsync's help output philosophy.
Files Changed
generator.c: Pre-scan logic inprescan_for_unchanged()io.c: IPC handler forMSG_FLIST_COUNToptions.c: Option definitions and validationprogress.c: Adjusted progress calculationrsync.h: New message type and stats fieldrsync.1.md: Comprehensive documentationNEWS.md: Enhancement entryExample Use Cases
Resumed large backups with accurate progress:
Remote synchronization with meaningful progress tracking:
Monitoring actual transfer progress (not inflated by unchanged files):
This enhancement addresses a long-standing UX issue that may confuse users, particularly those relying on progress reporting for automated backup systems and large data transfers where most files are typically unchanged.