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

git filter-branch --directory-filter oddity

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Dec 3, 2013, 22:44 UTC
Message-ID
<CACPiFC+nCj8VMqb+aK-C5gMyX6R0dDba1U1U49KTktF3WDQ9ZA@mail.gmail.com>

When using git filter-branch --prune-empty --directory-filter foo/bar to extract the history of the foo/bar directory, I am getting a very strange result.

Directory foo/bar is "slow moving". Say, 22 commits out of several thousand. I would like to extract just those 22 commits.

Instead, I get ~1500 commits, which seem to have not been skipped because they are merge commits. Merges completely immaterial to this directory.

As they have not been skipped, they are fully fleshed out. By this, I mean that we have the whole tree in place. So these 22 commits appear with foo/bar pulled out to the root of the project, in the midst of 1500 commits with a full tree.

The commit diffs make no sense what-so-ever.
Am I doing it wrong?
m
-- 
 martin.langhoff@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff
Next: Martin Langhoff
Message 1 of 3 in “git filter-branch --directory-filter oddity”
  1. Martin LanghoffDec 3, 2013
  2. Martin LanghoffDec 3, 2013
  3. Martin LanghoffDec 4, 2013

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.