Skip to content
  • Ramkumar Ramachandra's avatar
    sequencer: factor code out of revert builtin · 043a4492
    Ramkumar Ramachandra authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Expose the cherry-picking machinery through a public
    sequencer_pick_revisions() (renamed from pick_revisions() in
    builtin/revert.c), so that cherry-picking and reverting are special
    cases of a general sequencer operation.  The cherry-pick builtin is
    now a thin wrapper that does command-line argument parsing before
    calling into sequencer_pick_revisions().  In the future, we can write
    a new "foo" builtin that calls into the sequencer like:
    
      memset(&opts, 0, sizeof(opts));
      opts.action = REPLAY_FOO;
      opts.revisions = xmalloc(sizeof(*opts.revs));
      parse_args_populate_opts(argc, argv, &opts);
      init_revisions(opts.revs);
      sequencer_pick_revisions(&opts);
    
    This patch does not intend to make any functional changes.  Check
    with:
    
      $ git blame -s -C HEAD^..HEAD -- sequencer.c | grep -C3 '^[^^]'
    
    Signed-off-by: default avatarRamkumar Ramachandra <artagnon@gmail.com>
    Reviewed-by: default avatarJonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    043a4492