Re: [PATCH] Add git-filter-branch
- From
Johannes Sixt <j.sixt@eudaptics.com>
- Date
- Jun 4, 2007, 07:18 UTC
- Message-ID
- <4663BCDA.F1BADDD8@eudaptics.com>
- In-Reply-To
- <Pine.LNX.4.64.0706030129110.4046@racer.site>
Johannes Schindelin wrote:
Show 11 quoted lines
> > This script is derived from Pasky's cg-admin-rewritehist. > > In fact, it _is_ the same script, minimally adapted to work without cogito. > It _should_ be able to perform the same tasks, even if only relying on > core-git programs. > > All the work is Pasky's, just the adaption is mine. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > Hopefully-signed-off-by: Petr "cogito master" Baudis <pasky@suse.cz>
If you hadn't done that, I'd done it sooner or later. Thanks!
Show 6 quoted lines
> + -r)
> + unchanged="$(get_parents "$OPTARG") $unchanged"
> + ;;
> + -k)
> + unchanged="$(git-rev-parse "$OPTARG"^{commit}) $unchanged"
> + ;;These two (-r and -k) together with...
> +# seed with identity mappings for the parents where we start off > +for commit in $unchanged; do > + echo $commit > ../map/$commit > +done
... this and ...
Show 6 quoted lines
> + if [ -r "../map/$parent" ]; then > + for reparent in $(cat "../map/$parent"); do > + parentstr="$parentstr -p $reparent" > + done > + else > + die "assertion failed: parent $parent for commit $commit not found in rewritten ones"
... this, means that any simple command like
git filter-branch -k orgin/master origin/next new-next
of your git.git clone will fail with the "assertion failed". (I haven't tried your script, yet, but cg-admin-rewritehist fails.)
I propose that you just get rid of the "seed" stance and don't fail if a commit cannot be mapped - just use it unchanged (don't forget to adjust the map() function, too). Then you can get rid of -r and use -k to specify everything you want under "--not" in the rev-list.
-- Hannes