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

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
Previous: Johannes SixtNext: Johannes Sixt
Message 20 of 22 in “filter-branch: stop special-casing $filter_subdir argument”
  1. 1/2 filter-branch: stop special-casing $filter_subdir argumentThomas Rast, Oct 21, 2009
  2. 2/2 filter-branch: nearest-ancestor rewriting outside subdir filterThomas Rast, Oct 21, 2009
  3. 1/2 filter-branch: stop special-casing $filter_subdir argumentThomas Rast, Oct 21, 2009
  4. 2/2 filter-branch: nearest-ancestor rewriting outside subdir filterThomas Rast, Oct 21, 2009
  5. Johannes SixtOct 22, 2009
  6. Thomas RastOct 22, 2009
  7. Johannes SixtOct 22, 2009
  8. 1/2 filter-branch: stop special-casing $filter_subdir argumentThomas Rast, Oct 28, 2009
  9. 2/2 filter-branch: nearest-ancestor rewriting outside subdir filterThomas Rast, Oct 28, 2009
  10. Johannes SixtOct 29, 2009
  11. Johannes SixtOct 29, 2009
  12. 1/2 filter-branch: stop special-casing $filter_subdir argumentThomas Rast, Nov 10, 2009
  13. 2/2 filter-branch: nearest-ancestor rewriting outside subdir filterThomas Rast, Nov 10, 2009
  14. Johannes SixtNov 11, 2009
  15. 1/2 filter-branch: stop special-casing $filter_subdir argumentJohannes Sixt, Nov 11, 2009
  16. 2/2 filter-branch: nearest-ancestor rewriting outside subdir filterJohannes Sixt, Nov 11, 2009
  17. Junio C HamanoNov 11, 2009
  18. Thomas RastNov 11, 2009
  19. Johannes SixtNov 11, 2009
  20. Thomas RastNov 11, 2009
  21. Johannes SixtNov 11, 2009
  22. Junio C HamanoNov 11, 2009

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.