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

Re: [PATCH] Add git-filter-branch

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 3, 2007, 10:28 UTC
Message-ID
<200706031228.58779.jnareb@gmail.com>
In-Reply-To
<Pine.LNX.4.64.0706030147520.4046@racer.site>
On Sun, 3 Jun 2007, Johannes Schindelin wrote:
Show 14 quoted lines
> On Sun, 3 Jun 2007, Jakub Narebski wrote:
>> Johannes Schindelin wrote:
>> 
>>> This script is derived from Pasky's cg-admin-rewritehist.
>>> 
>>> In fact, it _is_ the same script, minimally adapted to work without cogito.
>>> It _should_ be able to perform the same tasks, even if only relying on
>>> core-git programs.
>>> 
>>> All the work is Pasky's, just the adaption is mine.
>> 
>> I was thinking about rewriting cg-adin-rewritehist as git-rewritehist
>> using Perl (IIRC it needs bash, not only POSIX shell), and make it
>> use git-fast-import.

By the way, why did you change name to git-filter-branch, instead of leaving it [almost] as is, i.e. git-rewritehist. Or if you wanted to emphasize that it rewrites only one branch at a time, git-rewrite-branch?

Note that history (branch) gets rewritten also in absence of filters, if there are any grafts in place. But I might be mistaken.

> First, it does not need Perl.
> 
> Second, it does not even need bash.

If I remember correctly (but I can be wrong here) Pasky said that he had to use arrays in cg-admin-rewritehist. Because introducing dependency on bash would be bad, that was the cause of thought to rewrite it in Perl (which we depend on anyway).

See below.
> At least that is what I tried to make sure. I replaced the only instance 
> of a bashim I was aware, namely the arrayism of $unchanged. It can be a 
> string just as well, as we are only storing object names in it.

I'm sorry, I haven't reviewed your patch carefully enough, it seems like. If you can translate cg-admin-rewritehist to POSIX shell, more power to you.

                          -- " --

Few notes of lesser importance (meaning they can go into subsequent commits).

1. Documentation: Cogito had documentation together with the command
   described, similarly to Perl POD, or LaTeX doc package + DocStrip,
   etc. It has IIRC rules in Makefile to extract documentation.
   In git we have documentation in separate files. The commands
   themselves have only usage, and sometimes long usage embedded.
   It would be nice of git-filter-branch / git-rewrite-branch also
   followed this convention.
2. Using fast-import.
   >> +# Note that since this operation is extensively I/O expensive, it might
   >> +# be a good idea to do it off-disk, e.g. on tmpfs. Reportedly the speedup
   >> +# is very noticeable.
   Would it be possible to use git-fast-import to reduce I/O in this
   command? Cogito didn't use it because it is quite new, but there
   is no reason to not to use it now, I think.
-- 
Jakub Narebski
Poland
Previous: Johannes SchindelinNext: Steven Grimm
Message 4 of 27 in “Add git-filter-branch”
  1. Add git-filter-branchJohannes Schindelin, Jun 3, 2007
  2. Jakub NarebskiJun 3, 2007
  3. Johannes SchindelinJun 3, 2007
  4. Jakub NarebskiJun 3, 2007
  5. Steven GrimmJun 3, 2007
  6. Johannes SchindelinJun 3, 2007
  7. Jonas FonsecaJun 5, 2007
  8. David KastrupJun 5, 2007
  9. Junio C HamanoJun 5, 2007
  10. Jonas FonsecaJun 5, 2007
  11. Johannes SchindelinJun 5, 2007
  12. filter-branch: use $(($i+1)) instead of $((i+1))Johannes Schindelin, Jun 6, 2007
  13. Johannes SixtJun 4, 2007
  14. Johannes SixtJun 4, 2007
  15. Johannes SchindelinJun 4, 2007
  16. Johannes SixtJun 4, 2007
  17. Johannes SchindelinJun 4, 2007
  18. Johannes SixtJun 5, 2007
  19. Johannes SchindelinJun 5, 2007
  20. Johannes SixtJun 6, 2007
  21. Junio C HamanoJun 6, 2007
  22. Johannes SchindelinJun 6, 2007
  23. Johannes SixtJun 6, 2007
  24. Johannes SchindelinJun 6, 2007
  25. filter-branch: also don't fail in map() if a commit cannot be mappedJohannes Sixt, Jun 6, 2007
  26. Johannes SchindelinJun 6, 2007
  27. filter-branch: also don't fail in map() if a commit cannot be mappedJohannes Sixt, Jun 6, 2007

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.