diff options
Diffstat (limited to 'git-follow')
-rw-r--r-- | git-follow/Makefile-files | 4 | ||||
-rw-r--r-- | git-follow/generate-patches.sh | 45 | ||||
-rw-r--r-- | git-follow/git-follow.in | 44 | ||||
-rw-r--r-- | git-follow/rebase-all.sh | 16 | ||||
-rw-r--r-- | git-follow/upload-patches.sh | 7 |
5 files changed, 116 insertions, 0 deletions
diff --git a/git-follow/Makefile-files b/git-follow/Makefile-files new file mode 100644 index 0000000..26d78b9 --- /dev/null +++ b/git-follow/Makefile-files @@ -0,0 +1,4 @@ +# -*- makefile -*- +bin_SCRIPTS += git-follow/git-follow +EXTRA_DIST += git-follow/git-follow.in +UPLOAD_FILES += git-follow/git-follow diff --git a/git-follow/generate-patches.sh b/git-follow/generate-patches.sh new file mode 100644 index 0000000..bf2c17a --- /dev/null +++ b/git-follow/generate-patches.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -x + +repourl="http://radeonhd.lauft.net/xf86-video-radeonhd.git/" +sedhtml="s/&/\&/g; s/@/\@/g; s/</\</g; s/>/\>/g;" + +rm -f "patches/"*/[0-9][0-9][0-9][0-9]-*.patch +rmdir "patches/"* + +while read start from to dir restofline +do + if echo "$start" | grep '^#' > /dev/null; then continue; fi + git format-patch -o "patches/$dir" --start-number "$start" "$from".."$to" + if test "x$to" = "x$dir"; then + { + echo "<h1 style='margin:0;'>${to} branch</h1>" + echo "<p><tt>git pull ${repourl} ${to}</tt></p>" + } > "patches/$dir/HEADER.html" + echo "IndexIgnore .." > "patches/$dir/.htaccess" + { + sedcmds="" + for f in "patches/$dir/"[0-9]*.patch; do + b="$(basename "$f")" + commit="$(sed -n '1s/^From \([a-z0-9]\{1,\}\).*/\1/p' "$f")" + sedcmds="${sedcmds} s|\(${commit}\)|<a href=\"$b\">\1</a>|;" + echo "AddDescription \"$(sed -n 's|^Subject: [PATCH[^\]*] \(.*\)|\1|p' "$f" | sed "${sedhtml}")\" ${b}" >> "patches/$dir/.htaccess" + done + echo "$commits" + echo "<pre style=\"\">" + git log --stat "${from}..${to}" | sed "${sedhtml}${sedcmds}" + echo "</pre>" + } > "patches/$dir/README.html" + fi +done<<EOF +#1 master ndim-trivial-fixes ndim-trivial-fixes +#1 ndim-trivial-fixes ndim-doc ndim-doc +1 ndim-trivial-fixes ndim-git-version ndim-git-version +101 ndim-doc ndim/update-docs manpage-update +201 ndim-doc ndim/update-docs-auto manpage-update +301 ndim-doc ndim/update-man-sed manpage-update +EOF + +( cd patches && tar cvfz ndim-all-radeonhd-patches.tar.gz --exclude .htaccess --exclude '*~' --exclude '*.tar.gz' --exclude 'HEADER.html' .) + +ls -l patches diff --git a/git-follow/git-follow.in b/git-follow/git-follow.in new file mode 100644 index 0000000..7d8d4b6 --- /dev/null +++ b/git-follow/git-follow.in @@ -0,0 +1,44 @@ +#!/bin/sh + +unset CDPATH +SED="${SED-sed}" + +self=`basename "$0"` +selfdir=`dirname "$0"` +selfdir=`cd "$selfdir" && pwd` +. "$selfdir/git-ndim-sh" + +SUBDIRECTORY_OK="yes" +USAGE="<command> [params...]" + +LONG_USAGE="\ +Let a local subtree of branches follow a remote origin without too much merging. +For more details, see the ${self}(1) man page." +. git-sh-setup + +require_work_tree + +# Abort on error +set -e + +gf_init() { + git config follow.tree | while read from to restofline; do + if test "x#" = "x$(echo "$from" | sed -n '1s/^\(.\).*/\1/p')"; then continue; fi + echo "ITEM" + echo " From: $from" + echo " To: $to" + done +} + +# The great command case +command="$1" +if shift; then + case "$command" in *) + die "Invalid command line parameter: \"$command\"" + ;; + esac +else + die "Command required" +fi + +# End of file. diff --git a/git-follow/rebase-all.sh b/git-follow/rebase-all.sh new file mode 100644 index 0000000..02676c7 --- /dev/null +++ b/git-follow/rebase-all.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -x +while read branch base restofline +do + git rebase "$base" "$branch" || exit "$?" +done<<EOF +master origin +ndim-trivial-fixes master +ndim-doc ndim-trivial-fixes +ndim/update-docs ndim-doc +ndim/update-docs-auto ndim-doc +ndim/update-man-sed ndim-doc +fedora/generate-xinf ndim-trivial-fixes +ndim-conntest-checks ndim-trivial-fixes +EOF diff --git a/git-follow/upload-patches.sh b/git-follow/upload-patches.sh new file mode 100644 index 0000000..88da064 --- /dev/null +++ b/git-follow/upload-patches.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -x +rsync -avz --delete patches/ "${RSYNC_HOST}:${RSYNC_DIR}/patches/" +for branch in "" ndim-trivial-fixes ndim-doc ndim-git-version +do + git push -f public ${branch} +done |