From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Michele Locati <michele@locati.it>
Cc: git@vger.kernel.org, Ian Campbell <ijc@hellion.org.uk>
Subject: Re: How to use filter-branch with --state-branch?
Date: Thu, 08 Mar 2018 10:25:35 +0100 [thread overview]
Message-ID: <87zi3inckw.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <P56D58$52E406B139FE9D3C295CB5ABAB5C8893@locati.it>
On Tue, Mar 06 2018, Michele Locati jotted:
> Recent versions of git filter-branch command introduced the --state-branch
> option.
> BTW I can't find any info about how this can be actually used.
>
> We have this repository on github:
> https://github.com/concrete5/concrete5
>
> When someone pushes to that repo, we clone it and execute
> `git filter-branch --subdirectory-filter concrete`
> to extract the concrete directory, and we push the result to
> https://github.com/concrete5/concrete5-core
> (including all the branches and tags)
>
> The script at the moment is this one:
> https://github.com/concrete5/core_splitter/blob/70879e676b95160f7fc5d0ffc22b8f7420b0580b/bin/splitcore
>
> I tried to use the --state-branch option on a local mirror, so that we could
> do an incremental filtering. Here's the script:
>
> # Executed just one time
> git clone --no-checkout --mirror \
> https://github.com/concrete5/concrete5.git work
> cd work
> git filter-branch \
> --subdirectory-filter concrete \
> --tag-name-filter cat \
> --prune-empty \
> --state-branch FILTERBRANCH_STATE \
> -- --all
> # Executed every time the repo is updated
> git remote update --prune
> git filter-branch \
> --subdirectory-filter concrete \
> --tag-name-filter cat \
> --prune-empty \
> --state-branch FILTERBRANCH_STATE \
> -- --all
>
> The first filter-branch call required 7168 steps, so did the second call...
> I also tried without the --prune option of remote update (I had to add
> --force to the second filter-branch), but nothing changed.
CC-ing the author of that feature. Usually I'd just look at how the
tests for it work to answer your question, but I see this new feature
made it in recently with no tests for it, which doesn't make me very
happy :(
next prev parent reply other threads:[~2018-03-08 9:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 15:17 How to use filter-branch with --state-branch? Michele Locati
2018-03-08 9:25 ` Ævar Arnfjörð Bjarmason [this message]
2018-03-08 9:40 ` Ian Campbell
2018-03-09 13:04 ` Michele Locati
2018-03-09 13:23 ` Ian Campbell
2018-03-09 17:17 ` Michele Locati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zi3inckw.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=ijc@hellion.org.uk \
--cc=michele@locati.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.