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

my git problem

From
AMAndrew Morton <akpm@linux-foundation.org>
Date
Apr 27, 2008, 18:29 UTC
Message-ID
<20080427112938.4dbe8e2a.akpm@linux-foundation.org>

git is really really bad to me during the merge window. Let's look at an example:

y:/usr/src/git26> cat .git/branches/git-ia64 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git#test

Now, I want to generate a plain patch against mainline which will add the patches which are in git-ia64 and which aren't in mainline. ie: when that patch is applied to mainline, we get git-ia64. Sounds simple.

A naive
	git-diff origin git-ia64
generates vast amounts of stuff which is already in mainline.  Things like
 b/drivers/media/video/au0828/au0828-dvb.c       |    2 
 b/drivers/media/video/au0828/au0828-i2c.c       |    6 
 b/drivers/media/video/au0828/au0828.h           |    8 
 b/drivers/media/video/cx23885/cx23885-dvb.c     |    4 
 b/drivers/media/video/cx88/Kconfig              |    1 
 b/drivers/media/video/cx88/cx88-blackbird.c     |    6 
 b/drivers/media/video/cx88/cx88-cards.c         |    1 
 b/drivers/media/video/cx88/cx88-dvb.c           |   32 
 b/drivers/media/video/em28xx/em28xx-core.c      |    2 
 b/drivers/media/video/ir-kbd-i2c.c              |   21 
 b/drivers/media/video/pvrusb2/Kconfig           |    1 

The appended script is what I usually use. It was worked out by Junio and I maybe a couple of years ago. It doesn't work very well: it still generates large numbers of changes which are already in mainline. Some of them are ia64 changes, some are not.

When Tony resyncs his tree with mainline this problem will correct itself. I drop the tree and repoll it daily until this happens.

I don't really have a bottom line here - but I would like the git developers to be aware that what is a fairly sensible usage scenario just doesn't seem to be satisfied at all well...

Thanks.
#!/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
}
doit()
{
	tree=$1
	upstream=$2
	cd $GIT_TREE
	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"
}
mkdir -p $PULL
if [ $1"x" = "-x" ]
then
	exit
fi
cd /usr/src
if [ $# == 0 ]
then
	trees=/usr/src/git-trees
else
	trees="$1"
fi
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
}
	
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
Next: Linus Torvalds
Message 1 of 21 in “my git problem”
  1. Andrew MortonApr 27, 2008
  2. Linus TorvaldsApr 27, 2008
  3. Andrew MortonApr 27, 2008
  4. Linus TorvaldsApr 27, 2008
  5. Andrew MortonApr 28, 2008
  6. Johannes SchindelinApr 28, 2008
  7. Andrew MortonApr 28, 2008
  8. Johannes SchindelinApr 28, 2008
  9. Linus TorvaldsApr 28, 2008
  10. J. Bruce FieldsApr 29, 2008
  11. Jakub NarebskiApr 30, 2008
  12. Andrew MortonApr 28, 2008
  13. Linus TorvaldsApr 28, 2008
  14. Andrew MortonApr 28, 2008
  15. Carl WorthMay 1, 2008
  16. Daniel BarkalowApr 28, 2008
  17. Andrew MortonApr 28, 2008
  18. Linus TorvaldsApr 28, 2008
  19. Johannes SchindelinApr 28, 2008
  20. Linus TorvaldsApr 28, 2008
  21. Andrew MortonApr 29, 2008

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.