Skip to content
  • Derrick Stolee's avatar
    maintenance: replace run_auto_gc() · a95ce124
    Derrick Stolee authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The run_auto_gc() method is used in several places to trigger a check
    for repo maintenance after some Git commands, such as 'git commit' or
    'git fetch'.
    
    To allow for extra customization of this maintenance activity, replace
    the 'git gc --auto [--quiet]' call with one to 'git maintenance run
    --auto [--quiet]'. As we extend the maintenance builtin with other
    steps, users will be able to select different maintenance activities.
    
    Rename run_auto_gc() to run_auto_maintenance() to be clearer what is
    happening on this call, and to expose all callers in the current diff.
    Rewrite the method to use a struct child_process to simplify the calls
    slightly.
    
    Since 'git fetch' already allows disabling the 'git gc --auto'
    subprocess, add an equivalent option with a different name to be more
    descriptive of the new behavior: '--[no-]maintenance'. Update the
    documentation to include these options at the same time.
    
    Signed-off-by: default avatarDerrick Stolee <dstolee@microsoft.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a95ce124