Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t4135/make-patches # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t4135 / make-patches` 45 lines ยท 965 bytes Raw Blame History 1 #!/bin/sh 2 3 do_filename() { 4 desc=$1 5 postimage=$2 6 7 rm -fr file-creation && 8 git init file-creation && 9 ( 10 cd file-creation && 11 git commit --allow-empty -m init && 12 echo postimage >"$postimage" && 13 git add -N "$postimage" && 14 git diff HEAD >"../git-$desc.diff" 15 ) && 16 17 rm -fr trad-modification && 18 mkdir trad-modification && 19 ( 20 cd trad-modification && 21 echo preimage >"$postimage.orig" && 22 echo postimage >"$postimage" && 23 ! diff -u "$postimage.orig" "$postimage" >"../diff-$desc.diff" 24 ) && 25 26 rm -fr trad-creation && 27 mkdir trad-creation && 28 ( 29 cd trad-creation && 30 mkdir a b && 31 echo postimage >"b/$postimage" && 32 ! diff -pruN a b >"../add-$desc.diff" 33 ) 34 } 35 36 do_filename plain postimage.txt && 37 do_filename 'with spaces' 'post image.txt' && 38 do_filename 'with tab' 'post image.txt' && 39 do_filename 'with backslash' 'post\image.txt' && 40 do_filename 'with quote' '"postimage".txt' && 41 expand add-plain.diff >damaged.diff || 42 { 43 echo >&2 Failed. && 44 exit 1 45 }