From: Rudolf Polzer Date: Fri, 20 Aug 2010 12:23:07 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.xonotic.org/xonotic X-Git-Tag: xonotic-v0.1.0preview~286^2 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=c3b65641f6ba82a8e001ab57b5d9117f907e7669;hp=a675524294f3da80f63b45b69afc2006b779a45f Merge branch 'master' of ssh://git.xonotic.org/xonotic --- diff --git a/all b/all index a24b92af..3e120e5b 100755 --- a/all +++ b/all @@ -792,7 +792,7 @@ case "$cmd" in elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ echo "$logdata"; echo "$diffdata"; } | less -r'; then git checkout "$realbase" org=`git rev-parse HEAD` - if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then + if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then git reset --hard "$org" GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref" reportdo4 cat "$t" diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index d6fd4424..72f427c7 100755 --- a/misc/tools/cached-converter.sh +++ b/misc/tools/cached-converter.sh @@ -177,6 +177,7 @@ for F in "$@"; do will_jpeg=$do_jpeg will_dds=$do_dds case "$f" in + *_bump) will_dds=false ;; ./models/player/*) will_dds=false ;; ./textures/*) ;; ./models/*) ;; diff --git a/misc/tools/git-pk3-import b/misc/tools/git-pk3-import new file mode 100755 index 00000000..ee081d48 --- /dev/null +++ b/misc/tools/git-pk3-import @@ -0,0 +1,133 @@ +#!/bin/sh + +# git-pk3-import: Import a PK3 into a branch of a bare Git repo. + +set -x + +# Helpers + +die() +{ + echo "$(basename "$0"): error: $*" >&2 + exit 1 +} + +usage() +{ + cat < /dev/null +} + +# Clean up on exit + +cleanup_index= +cleanup_worktree= + +cleanup() +{ + [ "$cleanup_index" ] && rm -f "$GIT_INDEX_FILE" + [ "$cleanup_worktree" ] && find "$GIT_WORK_TREE" -mindepth 1 -delete +} + +trap cleanup EXIT + +# Set up index file, makes testing easier +[ -z "$GIT_INDEX_FILE" ] && { + export GIT_INDEX_FILE="$GIT_DIR/pk3-import-index" + cleanup_index=t +} + +# Extract the PK3 (the -n suppresses prompting in an edge case) +unzip -n -qq "$pk3path" -d "$GIT_WORK_TREE" || +die "couldn't extract PK3 contents" +cleanup_worktree=t + +# Note the refs and the common ancestor +master=refs/heads/master +ref=refs/heads/$branch +base=$(git merge-base $master $ref 2> /dev/null) || +base=$master + +# Figure out the parent commit +parent=\ +$(git rev-parse --verify -q $ref || git rev-parse --verify -q $base) || +die "couldn't determine parent commit" + +# Read the tree at base into index +git read-tree $base || +die "couldn't initialize index" + +# Reject any modified files, the mapper should create a branch instead +[ -z "$(git diff-files --diff-filter=M)" ] || +die "found changes to files in master" + +# Force reading of .gitignore files from cache, not the work tree +git ls-files --cached -z | +grep -z '\.gitignore$' | +git update-index --skip-worktree -z --stdin || +die "couldn't set up exclude patterns from index" + +# Add untracked files; to filter out generated files such as BSP, add +# them to .gitignore and push, --exclude-standard (and the above hack) +# takes care of the rest +git ls-files --exclude-standard -o -z | +git update-index --add -z --stdin || +die "couldn't add files to index" + +# Check if the index contains changes against parent +git diff-index --cached --quiet $parent && +die "found no changes to commit" + +# Commit the index and point the ref to the new commit +tree=$(git write-tree) && +commit=$(message | git commit-tree $tree -p $parent) && +git update-ref -m "pk3-import: $pk3name" $ref $commit || +die "couldn't commit changes" diff --git a/misc/tools/git-pk3-merge b/misc/tools/git-pk3-merge new file mode 100755 index 00000000..69e8298c --- /dev/null +++ b/misc/tools/git-pk3-merge @@ -0,0 +1,97 @@ +#!/bin/sh + +# git-pk3-merge: Attempt a trivial merge of master in a bare repo. + +set -x + +# Helpers + +die() +{ + echo "$(basename "$0"): error: $*" >&2 + exit 1 +} + +usage() +{ + cat < /dev/null) || +die "couldn't determine the common ancestor" + +# Figure out the parent commits +parent1=$(git rev-parse --verify -q $ref) && +parent2=$(git rev-parse --verify -q $master) || +die "couldn't determine parent commits" + +# Attempt a trivial merge +git read-tree -i -m --aggressive --trivial $base $ref $master || +die "couldn't do a trivial merge" + +# Check if the index contains changes against parent +git diff-index --cached --quiet $parent1 && +die "found no changes to commit" + +# Commit the index and point the ref to the new commit +tree=$(git write-tree) && +commit=$(message | git commit-tree $tree -p $parent1 -p $parent2) && +git update-ref -m "pk3-merge" $ref $commit || +die "couldn't commit merge" diff --git a/misc/tools/normalmap.sh b/misc/tools/normalmap.sh new file mode 100755 index 00000000..08ca0fae --- /dev/null +++ b/misc/tools/normalmap.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# usage: ./bump2norm.sh foo_bump.tga foo_norm.tga +# NOTE: unfortunately requires X-server (otherwise file-tga-save won't work... no joke) + +in=$1 +out=$2 + +# env variables you can set: +# filter: +# Filter type (0 = 4 sample, 1 = sobel 3x3, 2 = sobel 5x5, 3 = prewitt 3x3, 4 = prewitt 5x5, 5-8 = 3x3,5x5,7x7,9x9) +# minz: +# Minimun Z (0 to 1) +# scale: +# Scale (>0) +# heightsource: +# Height source (0 = average RGB, 1 = alpha channel) +# conv: +# Conversion (0 = none, 1 = Biased RGB, 2 = Red, 3 = Green, 4 = Blue, 5 = Max RGB, 6 = Min RGB, 7 = Colorspace) +: ${filter:=0} +: ${minz:=0} +: ${scale:=1} +: ${heightsource:=0} +: ${conv:=0} + +gimp -i -b - <