Re: q: faster way to integrate/merge lots of topic branches?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Wednesday, July 23, 2008 - 7:56 am

* Jay Soffian <jaysoffian@gmail.com> wrote:


yeah, i just figured it out too ... the hard way :)

Updated script below. This works fine across resets in the master 
branch.

While it's fast in the empty-merge case, it's not as fast as i'd like it 
to be in the almost-empty-merge case.

	Ingo

--------------{ git-fastmerge }-------------------->
#!/bin/bash

usage () {
  echo 'usage: tip-fastmerge <refspec>..'
  exit -1
}

[ $# = 0 ] && usage

BRANCH=$1

MERGECACHE=.git/mergecache

[ ! -d $MERGECACHE ] && { mkdir $MERGECACHE || usage; }

HEADREF=.git/$(cut -d' ' -f2 .git/HEAD)

HEAD_SHA1=$(git-log -1 --pretty=format:"%H")
BRANCH_SHA1=$(git-log -1 --pretty=format:"%H" $BRANCH)

CACHE=$MERGECACHE/$HEAD_SHA1/$BRANCH_SHA1

[ -f "$CACHE" -a "$CACHE" -nt "$HEADREF" ] && {
# echo "merge-cache hit on HEAD <= $1"
  exit 0
}

git-merge $1 && {
  mkdir -p $(dirname $CACHE)
  touch $CACHE
}

--
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:
Re: q: faster way to integrate/merge lots of topic branches?, Andreas Ericsson, (Wed Jul 23, 6:40 am)
Re: q: faster way to integrate/merge lots of topic branches?, Ingo Molnar, (Wed Jul 23, 7:56 am)
Re: q: faster way to integrate/merge lots of topic branches?, Linus Torvalds, (Wed Jul 23, 10:59 am)
Re: q: faster way to integrate/merge lots of topic branches?, Junio C Hamano, (Wed Jul 23, 10:59 am)
Re: q: faster way to integrate/merge lots of topic branches?, Linus Torvalds, (Wed Jul 23, 11:04 am)
Re: q: faster way to integrate/merge lots of topic branches?, Linus Torvalds, (Wed Jul 23, 11:12 am)
Re: q: faster way to integrate/merge lots of topic branches?, Pierre Habouzit, (Wed Jul 23, 12:09 pm)
Re: q: faster way to integrate/merge lots of topic branches?, Pierre Habouzit, (Wed Jul 23, 1:27 pm)
Re: q: faster way to integrate/merge lots of topic branches?, Pierre Habouzit, (Wed Jul 23, 1:40 pm)