Re: [PATCH v5 1/2] filter-branch: stop special-casing $filter_subdir argument
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Nov 11, 2009, 10:24 UTC
- Message-ID
- <200911111124.52340.trast@student.ethz.ch>
- In-Reply-To
- <4AFA7B9A.4090005@viscovery.net>
Johannes Sixt wrote in the other reply:
> I thought that the intention to give an extra path argument is to reduce > the number of commits that remain in the rewritten history. But by giving > --subdirectory-filter, the path filter actually loosened, and many more > commits are rewritten.
Right, I had a thinko there, the path filter adds up as an "or", so filtering for paths outside the subdir loosens it (and filtering for more paths inside doesn't make a difference).
> Since your intention to write this patch is actually to implement > --remap-to-ancestor, I suggest that we defer the question whether the > above use-case makes sense, and only rewrite this particular paragraph in > the commit message to point out the real bug:
Agreed.
Johannes Sixt wrote:
Show 7 quoted lines
> Furthermore, --subdirectory-filter supplies its own '--', and if the user > provided one himself, such as in > > git filter-branch --subdirectory-filter subdir -- --all -- subdir/file > > an extra '--' was used as path filter in the call to git-rev-list that > determines the commits that shall be rewritten.
There's some stray space here that should probably also be removed.
> Here it is. The interdiff to your version is merely
[...]
> # we need "--" only if there are no path arguments in $@
> nonrevs=$(git rev-parse --no-revs "$@") || exit
> -dashdash=${nonrevs+"--"}
> +test -z "$nonrevs" && dashdash=-- || dashdash=Ack.
--
Thomas Rast
trast@{inf,student}.ethz.ch