git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: David WoodhouseNext: David Woodhouse
Message 7 of 18 in “Kernel nightly snapshots..”
  1. Linus TorvaldsMay 5, 2005
  2. H. Peter AnvinMay 5, 2005
  3. David WoodhouseMay 5, 2005
  4. Linus TorvaldsMay 5, 2005
  5. David WoodhouseMay 5, 2005
  6. David WoodhouseMay 5, 2005
  7. Linus TorvaldsMay 5, 2005
  8. David WoodhouseMay 7, 2005
  9. H. Peter AnvinMay 6, 2005
  10. David WoodhouseMay 6, 2005
  11. H. Peter AnvinMay 6, 2005
  12. Marcelo TosattiMay 6, 2005
  13. Thomas GlanzmannMay 22, 2005
  14. David WoodhouseMay 22, 2005
  15. Thomas GlanzmannMay 22, 2005
  16. Russell KingMay 22, 2005
  17. Linus TorvaldsMay 5, 2005
  18. David WoodhouseMay 6, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.