Re: Untracked working tree files

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Thursday, October 16, 2008 - 2:32 am

On Thu, 16 Oct 2008 10:42:13 +0200 "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com> wrote:


oh gee, you don't want to look.  It should all be in
http://userweb.kernel.org/~akpm/stuff/patch-scripts.tar.gz

But really it's just the one script, pull-git-patches, below.  That
thing's been hacked around so much that I daren't breathe on it.

Fortunately as long as Stephen Rothwell is producing linux-next I don't
have much need for it any more.




#!/bin/sh

GIT_TREE=/usr/src/git26
PULL=/usr/src/pull

git_header()
{
	tree="$1"
	echo GIT $(cat .git/refs/heads/$tree) $(cat .git/branches/$tree)
	echo
}

# maybe use git clean -dqfx

doit()
{
	tree=$1
	upstream=$2

	cd $GIT_TREE
	git checkout -f "$upstream"
	git reset --hard "$upstream"
	git fetch "$tree" || exit 1
	git merge --no-commit 'test merge' HEAD FETCH_HEAD > /dev/null

	{
		git_header "$tree"
		git log --no-merges ORIG_HEAD..FETCH_HEAD
		git diff --patch-with-stat ORIG_HEAD
	} >$PULL/$tree.patch
	{
		echo DESC
		echo $tree.patch
		echo EDESC
		git_header "$tree"
		git log --no-merges ORIG_HEAD..FETCH_HEAD
	} >$PULL/$tree.txt
	git reset --hard "$upstream"
}

do_one()
{
	tree=$1
	upstream=$2
	if [ ! -e $PULL/$tree.patch ]
	then
		echo "*** doing $tree, based on $upstream"
		git branch -D $tree
		doit $tree $upstream
	else
		echo skipping $tree
	fi
}

mkdir -p $PULL

if [ $1"x" = "-x" ]
then
	exit
fi

cd $GIT_TREE
git checkout -f master

cd /usr/src

if [ $# == 0 ]
then
	trees=/usr/src/git-trees
else
	trees="$1"
fi

if [ $# == 2 ]
then
	do_one $1 $2
else
	while read x
	do
		if echo $x | grep '^#.*' > /dev/null
		then
			true
		else
			do_one $x
		fi
	done < $trees
fi



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Untracked working tree files, Andrew Morton, (Wed Oct 15, 11:56 am)
Re: Untracked working tree files, david, (Wed Oct 15, 12:09 pm)
Re: Untracked working tree files, david, (Wed Oct 15, 12:14 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 12:24 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 12:26 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 12:31 pm)
Re: Untracked working tree files, Nicolas Pitre, (Wed Oct 15, 12:32 pm)
Re: Untracked working tree files, Nicolas Pitre, (Wed Oct 15, 12:34 pm)
Re: Untracked working tree files, david, (Wed Oct 15, 12:42 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 12:49 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 12:56 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 1:08 pm)
Re: Untracked working tree files, david, (Wed Oct 15, 1:17 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 1:23 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 1:23 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 1:30 pm)
Re: Untracked working tree files, Junio C Hamano, (Wed Oct 15, 3:06 pm)
Re: Untracked working tree files, Paolo Ciarrocchi, (Thu Oct 16, 1:42 am)
Re: Untracked working tree files, Andrew Morton, (Thu Oct 16, 2:32 am)