• P
    builtin-am: support and auto-detect StGit patches · 5ae41c79
    Paul Tan 提交于
    Since c574e683 (git-am foreign patch support: StGIT support, 2009-05-27),
    git-am.sh supported converting StGit patches into RFC2822 mail patches
    that can be parsed with git-mailinfo.
    
    Implement this by introducing two functions in builtin/am.c:
    stgit_patch_to_mail() and split_mail_conv().
    
    stgit_patch_to_mail() is a callback function for split_mail_conv(), and
    contains the logic for converting an StGit patch into an RFC2822 mail
    patch.
    
    split_mail_conv() implements the logic to go through each file in the
    `paths` list, reading from stdin where specified, and calls the callback
    function to write the converted patch to the corresponding output file
    in the state directory. This interface should be generic enough to
    support other foreign patch formats in the future.
    
    Since 15ced753 (git-am foreign patch support: autodetect some patch
    formats, 2009-05-27), git-am.sh is able to auto-detect StGit patches.
    Re-implement this in builtin/am.c.
    Helped-by: NEric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: NPaul Tan <pyokagan@gmail.com>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    5ae41c79
am.c 51.7 KB