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

Re: Understanding git filter-branch --subdirectory-filter behaviour

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 21, 2008, 06:26 UTC
Message-ID
<4833C07B.3060004@viscovery.net>
In-Reply-To
<e1dab3980805201311m3cbde4f2id8c3493a25745238@mail.gmail.com>
David Tweed schrieb:
Show 7 quoted lines
> $ git filter-branch --subdirectory-filter WRITING/ HEAD
> Rewrite 42f24be8d8198738134a19471697b39359199fa3 (351/351)
> Ref 'refs/heads/master' was rewritten
> 
> $ git rev-list HEAD | wc
>      55      55    2255
> 
...
Show 10 quoted lines
> 
> Digging a little into the shell-script I find the list of commits is
> generated with
> 
> git rev-list --reverse --topo-order --default HEAD --parents HEAD
> --full-history -- WRITING
> 
> and (adding --pretty so I can easily read it) running this manually
> gives 351 entries and looks to contain the expected commits. So I'm
> confused what's happening?
That's difficult to tell without a peek at the repository.

Did you compare 'gitk HEAD' to 'gitk HEAD -- WRITING'? I'd expect the latter to be a subset of the former. Note that with a path specified "history simplification" happens, which means that you won't see as many merges as when no path is specified.

-- Hannes
Previous: David TweedNext: David Tweed
Message 2 of 3 in “Understanding git filter-branch --subdirectory-filter behaviour”
  1. David TweedMay 20, 2008
  2. Johannes SixtMay 21, 2008
  3. David TweedMay 22, 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.