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

Re: git filter-branch --directory-filter oddity

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Dec 3, 2013, 22:58 UTC
Message-ID
<CACPiFCLY+nS1S=-x6WA4wHJtMcAf_ks18b6YVhiJjJSZtRKK7g@mail.gmail.com>
In-Reply-To
<CACPiFC+nCj8VMqb+aK-C5gMyX6R0dDba1U1U49KTktF3WDQ9ZA@mail.gmail.com>

On Tue, Dec 3, 2013 at 5:44 PM, Martin Langhoff <martin.langhoff@gmail.com> wrote:

> 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.
IOWs, I am experimenting with something like:

git filter-branch -f -d /tmp/moodle-$RANDOM --prune-empty --index-filter "git ls-files -z | grep -zZ -v '${dirpath}' | xargs -0 --no-run-if-empty -n100 git rm --quiet --cached --ignore-unmatch " ^v2.1.0 $branches git filter-branch -f --prune-empty --subdirectory-filter ${dirpath} ^v2.1.0 $branches git filter-branch -f --commit-filter "~/src/git-filter-branch-tools/remove-pointless-commit.rb \"\$@\"" ^v2.1.0 $branches

perhaps the docs for filter-branch imply, to me at least, that it's a DWIM tool. I am surprised at having to roll my own on something that is fairly popular.

cheers,
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
Previous: Martin LanghoffNext: Martin Langhoff
Message 2 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.