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

Re: [PATCH v2] filter-branch: use printf instead of echo -e

From
Michele Locati <michele@locati.it>
Date
Mar 22, 2018, 13:40 UTC
Message-ID
<081ccfce-7a89-503e-465e-3befe6f33f17@locati.it>
In-Reply-To
<nycvar.QRO.7.76.6.1803212249170.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
Il 21/03/2018 22:50, Johannes Schindelin ha scritto:
Show 13 quoted lines
> Hi Michele,
> 
> On Mon, 19 Mar 2018, Michele Locati wrote:
> 
>> [...]
>> -- 
>> 2.16.2.windows.1
> 
> Yaaaaay!
> 
> Out of curiosity: did the CONTRIBUTING.md file help that was recently
> turned into a guide how to contribute to Git (for Windows) by Derrick
> Stolee?
Well, no. Here's what led me here...

The people behind the concrete5 CMS asked support for improving the following procedure:

concrete5 is stored in https://github.com/concrete5/concrete5 In order to make it installable with Composer (a PHP package manager), we need to extract its "/concrete" directory, and push the results to https://github.com/concrete5/concrete5-core We previously used "git filter-branch --all" with this script: https://github.com/concrete5/core_splitter/blob/70879e676b95160f7fc5d0ffc22b8f7420b0580b/bin/splitcore

That script is executed every time someone pushes concrete5/concrete5, and it took very long time (3~5 minutes).

I noticed on the git-filter-branch manual page that there's a "--state-branch", and it seemed quite interesting. So, I asked in git@vger.kernel.org how to use it, and the author of that feature (Ian Campbell) told me to look at some code he wrote. So, I wrote https://github.com/concrete5/incremental-filter-branch which wraps "git filter-branch --filter-state", and it's used in https://github.com/concrete5/core_splitter/blob/99bbbcea1ab90572a04864ccb92327532ab6a42c/bin/splitcore (it not yet in production: Korvin wants to be sure everything works well before adopting it) The time required for the operation dropped from 3~5 minutes to ~10 seconds ;)

While writing that script, I noticed a couple of things that could be improved in "git-filter-branch", so I submitted https://marc.info/?l=git&m=152111905428554&w=2 (so that the script could run without problems if there's nothing to do) and https://marc.info/?l=git&m=152147095416175&w=2 (so that --filter-state could be used on Mac and other non-Linux systems). How did I learn how to submit to git? I searched for "git src", landed on https://github.com/git/git, read Documentation/SubmittingPatches and used git send-email.

And yes, all that on Windows (and WSL).
> 
> Ciao,
> Johannes
Ciao!

-- Michele

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 10 in “filter-branch: use printf instead of echo -e”
  1. filter-branch: use printf instead of echo -eMichele Locati, Mar 19, 2018
  2. filter-branch: use printf instead of echo -eMichele Locati, Mar 19, 2018
  3. Junio C HamanoMar 19, 2018
  4. Johannes SchindelinMar 21, 2018
  5. Michele LocatiMar 22, 2018
  6. Johannes SchindelinMar 23, 2018
  7. CB BaileyMar 19, 2018
  8. Jeff KingMar 20, 2018
  9. Ian CampbellMar 20, 2018
  10. Michele LocatiMar 20, 2018

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.