Skip to content
  • Derrick Stolee's avatar
    commit/revisions: bookkeeping before refactoring · 5284fc5c
    Derrick Stolee authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    There are a few things that need to move around a little before
    making a big refactoring in the topo-order logic:
    
    1. We need access to record_author_date() and
       compare_commits_by_author_date() in revision.c. These are used
       currently by sort_in_topological_order() in commit.c.
    
    2. Moving these methods to commit.h requires adding an author_date_slab
       declaration to commit.h. Consumers will need their own implementation.
    
    3. The add_parents_to_list() method in revision.c performs logic
       around the UNINTERESTING flag and other special cases depending
       on the struct rev_info. Allow this method to ignore a NULL 'list'
       parameter, as we will not be populating the list for our walk.
       Also rename the method to the slightly more generic name
       process_parents() to make clear that this method does more than
       add to a list (and no list is required anymore).
    
    Helped-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarDerrick Stolee <dstolee@microsoft.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    5284fc5c