Re: Kernel nightly snapshots..
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 5, 2005, 16:40 UTC
- Message-ID
- <Pine.LNX.4.58.0505050846530.2328@ppc970.osdl.org>
- In-Reply-To
- <1115307033.16187.146.camel@hades.cambridge.redhat.com>
On Thu, 5 May 2005, David Woodhouse wrote:
Show 8 quoted lines
> > Eep. That'll be a whole lot more useful if I do > cg-diff -r $RELTREE:$CURTREE > instead of > cg-diff -r $CURTREE:$RELTREE > ... but it should be OK now. This is the md5sum of the correct one: > > 21a0ee13c539e8b016682c1542bb9167 patch-2.6.12-rc3-git1.gz
Btw, if you want to, you could simplify and optimize things heavily by doign some very specific git internal mucking around, and using the new "-m" flag I added to "git-diff-cache".
The "-m" flag says that a file that isn't checked out will always match the cache, which means that you can create your magic diffs that modify the Makefile with something like this:
export SNAP_TAG_DIRECTORY=/pub/linux/kernel/v2.6/snapshots/tags export BASE_DIRECTORY=/pub/scm/linux/kernel/git/torvalds/linux-2.6 export SHA1_FILE_DIRECTORY=$BASE_DIRECTORY/objects
RELNAME=`ls $BASE_DIRECTORY/refs/tags | tail -1` RELCOMM=`cat $BASE_DIRECTORY/refs/tags/$RELNAME` CURCOMM=`cat $BASE_DIRECTORY/HEAD`
SNAPNAME=`ls $SNAP_TAG_DIRECTORY | grep -- "$RELNAME-git" | tail -1` if [ "$SNAPNAME" ]; then SNAPCOMM=`cat $SNAP_TAG_DIRECTORY/$SNAPNAME` [ "$SNAPCOMM" == "$CURCOMM" ] && exit 0 OLDGITNUM=`echo $SNAPNAME | sed s/^.*-git//` NEWGITNUM=`expr $OLDGITNUM + 1` CURNAME="$RELNAME-git$NEWGITNUM" else CURNAME="$RELNAME-git1" fi
EXTRAVERSION=-`echo $CURNAME | cut -f2- -d-`
rm -rf tmp-empty-tree mkdir -p tmp-empty-tree/.git ( cd tmp-empty-tree git-read-tree $CURCOMM git-checkout-cache Makefile perl -pi -e "s/EXTRAVERSION =.*/EXTRAVERSION = $EXTRAVERSION/" Makefile git-diff-cache -m -p $RELCOMM ) | gzip -9 > patch-$CURNAME.gz
echo CURCOMM > $SNAP_TAG_DIRECTORY/$CURNAME
but it's entirely untested, and only written in my mail editor, so..
Anyway, here's explaining what it does:
- it creates a new "tmp-empty-tree" thing, and points the object database to _my_ tree (which is unwritable for you, but you don't care, you just want to read it)
- it picks up my last tag as the release, and your last git tag from your private snapshot tag directory as the last git thing. Then it takes my current HEAD as the new thing to diff.
- we read that current tree into this empty tree, but we don't check any of it out except for the Makefile. So the "tmp-empty-tree" should literally just have the files "Makefile" and ".git/index" in it.
- we edit the Makefile, and then we do "git-diff-cache -m -p" between the result and the old base.
This _should_ work. Modulo bugs. And it should be reasonably efficient. It just needs my current git tree as of five minutes ago..
Linus