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

Re: [PATCH 4/4] Add git-rewrite-commits

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 8, 2007, 16:37 UTC
Message-ID
<Pine.LNX.4.64.0707081729040.4248@racer.site>
In-Reply-To
<1183911808787-git-send-email-skimo@liacs.nl>
Hi,
On Sun, 8 Jul 2007, skimo@liacs.nl wrote:
Show 13 quoted lines
> 	bash-3.00$ time git-filter-branch test
> 	Rewrite 274fe3dfb8e8c7d0a6ce05138bdb650de7b459ea (425/425)
> 	Rewritten history saved to the test branch
> 
> 	real    0m30.845s
> 	user    0m13.400s
> 	sys     0m19.640s
> 
> 	bash-3.00$ time git-rewrite-commits
> 
> 	real    0m0.223s
> 	user    0m0.080s
> 	sys     0m0.140s

That is to be expected. After all, the first is a script. However, I really have ask: how often per hour do you want to run that program?

Show 10 quoted lines
> The command line is more reminiscent of git-log.
> For example you can say
> 
> 	git-rewrite-commits --all
> 
> to incorporate grafts in all branches, or
> 
> 	git rewrite-commits --author='!Darl McBribe' --all
> 
> to remove all commits by Darl McBribe.

I am really unhappy that so much is talked about filtering out commits. That is amost certainly not what you want in most cases. In particular, I suspect that most users would expect the _changes_ filtered out by such a command, which is just not true.

Further, I do not see much value in making this operation faster. It is meant to be a one-time operation, for example when you open-source a product and have to cull a lot of history that you must not show for legal reasons. It is a one-shot operation. And having a script which works reliably is more valuable than having two programs, each with its own set of bugs.

So there are two things I see here that filter-branch cannot do yet. The first is to rewrite _all_ branches, which should be easy to do, it only has to be done.

The second is to rewrite the commit messages so that the hashes are mapped, too. But that should be relatively easy, too: you can provide a message filter, and you can use the provided "map" function. If this seems to be what many people need, you can write a simple function and put it into filter-branch for common use.

BTW I am not at all opposed to changing the name from filter-branch to something that fits better.

Ciao, Dscho

Previous: skimo@liacs.nlNext: Sven Verdoolaege
Message 6 of 25 in “Add git-rewrite-commits”
  1. 0/4 Add git-rewrite-commitsskimo@liacs.nl, Jul 8, 2007
  2. 1/4 export get_short_sha1skimo@liacs.nl, Jul 8, 2007
  3. 2/4 export add_ref_decorationskimo@liacs.nl, Jul 8, 2007
  4. 3/4 revision: mark commits that didn't match a pattern for later useskimo@liacs.nl, Jul 8, 2007
  5. 4/4 Add git-rewrite-commitsskimo@liacs.nl, Jul 8, 2007
  6. Johannes SchindelinJul 8, 2007
  7. Sven VerdoolaegeJul 8, 2007
  8. Johannes SchindelinJul 8, 2007
  9. Sven VerdoolaegeJul 8, 2007
  10. Steven GrimmJul 8, 2007
  11. Sven VerdoolaegeJul 8, 2007
  12. Johannes SchindelinJul 8, 2007
  13. Sven VerdoolaegeJul 8, 2007
  14. Johannes SixtJul 9, 2007
  15. Sven VerdoolaegeJul 9, 2007
  16. Johannes SchindelinJul 9, 2007
  17. Johannes SchindelinJul 8, 2007
  18. Sven VerdoolaegeJul 9, 2007
  19. Johannes SchindelinJul 9, 2007
  20. Sven VerdoolaegeJul 9, 2007
  21. Johannes SchindelinJul 9, 2007
  22. Sven VerdoolaegeJul 9, 2007
  23. Johannes SchindelinJul 9, 2007
  24. Jeff KingJul 9, 2007
  25. Johannes SchindelinJul 9, 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.