llvm.org GIT mirror llvm / c1076ea
Delete mkpatch. Everything it does is already done by svn diff by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110203 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
2 changed file(s) with 7 addition(s) and 49 deletion(s). Raw diff Collapse all Expand all
106106 patches may not apply correctly if the underlying code changes between the
107107 time the patch was created and the time it is applied.
108108
109
  • Patches should be made with this command:
  • 110
    111
    
                      
                    
    112 svn diff
    113
    114
    115 or with the utility utils/mkpatch, which makes it easy to read
    116 the diff.
    117
    118
  • Patches should not include differences in generated code such as the code
  • 119 generated by autoconf or tblgen. The
    120 utils/mkpatch utility takes care of this for you.
    109
  • Patches should be made with svn diff, or similar. If you use
  • 110 a different tool, make sure it uses the diff -u format and
    111 that it doesn't contain clutter which makes it hard to read.
    112
    113
  • If you are modifying generated files, such as the top-level
  • 114 configure script, please separate out those changes into
    115 a separate patch from the rest of your changes.
    121116
    122117
    123118

    When sending a patch to a mailing list, it is a good idea to send it as an

    +0
    -37
    utils/mkpatch less more
    None #!/bin/bash
    1 #
    2 # This script makes a patch for LLVM ensuring the correct diff options and
    3 # putting the files in a standard review order.
    4
    5
    6 function error {
    7 retcode="$?"
    8 echo "mkpatch: error: $1 ($retcode)"
    9 exit 1
    10 }
    11
    12 if [ ! -e llvm.spec.in ] ; then
    13 error "Please change directory to the LLVM top source directory"
    14 fi
    15 if [ "$#" -ne 1 ] ; then
    16 error "usage: utils/mkpatch [PATCH_NAME]"
    17 fi
    18 NAME="$1"
    19 echo "mkpatch: Generating differences on top level files"
    20 svn diff -N -x -u > "$NAME".patch.raw 2>&1
    21 echo "mkpatch: Generating differences on all directories"
    22 svn diff -x -u >> "$NAME".patch.raw 2>&1 \
    23 autoconf docs utils include lib/System lib/Support lib/VMCore lib/AsmParser \
    24 lib/Bitcode lib/Analysis lib/Transforms lib/CodeGen lib/Target \
    25 lib/ExecutionEngine lib/Linker lib/MC \
    26 tools test unittests runtime projects examples Xcode
    27
    28 echo "mkpatch: Removing cruft from the patch file"
    29 sed -e '/^[?] .*/d' -e '/^cvs diff: Diffing/d' "$NAME".patch.raw | awk '\
    30 BEGIN { deleting = 0; } \
    31 /^Index: .*[.]cvs$/ { deleting = 1; fname=substr($0,7); \
    32 print "Skipping: ", fname > "/dev/stderr"; } \
    33 /^Index:.*/ && !/^Index: .*[.]cvs$/ { deleting = 0; } \
    34 { if (! deleting) { print; } } ' > "$NAME".patch || \
    35 error "sed/awk cleanup failed"
    36