• X
    format-patch: add '--base' option to record base tree info · fa2ab86d
    Xiaolong Ye 提交于
    Maintainers or third party testers may want to know the exact base tree
    the patch series applies to. Teach git format-patch a '--base' option
    to record the base tree info and append it at the end of the first
    message (either the cover letter or the first patch in the series).
    
    The base tree info consists of the "base commit", which is a well-known
    commit that is part of the stable part of the project history everybody
    else works off of, and zero or more "prerequisite patches", which are
    well-known patches in flight that is not yet part of the "base commit"
    that need to be applied on top of "base commit" in topological order
    before the patches can be applied.
    
    The "base commit" is shown as "base-commit: " followed by the 40-hex of
    the commit object name.  A "prerequisite patch" is shown as
    "prerequisite-patch-id: " followed by the 40-hex "patch id", which can
    be obtained by passing the patch through the "git patch-id --stable"
    command.
    
    Imagine that on top of the public commit P, you applied well-known
    patches X, Y and Z from somebody else, and then built your three-patch
    series A, B, C, the history would be like:
    
    ---P---X---Y---Z---A---B---C
    
    With "git format-patch --base=P -3 C" (or variants thereof, e.g. with
    "--cover-letter" of using "Z..C" instead of "-3 C" to specify the
    range), the base tree information block is shown at the end of the
    first message the command outputs (either the first patch, or the
    cover letter), like this:
    
    base-commit: P
    prerequisite-patch-id: X
    prerequisite-patch-id: Y
    prerequisite-patch-id: Z
    Helped-by: NJunio C Hamano <gitster@pobox.com>
    Helped-by: NWu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: NXiaolong Ye <xiaolong.ye@intel.com>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    fa2ab86d
log.c 48.2 KB