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

Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 31, 2008, 22:42 UTC
Message-ID
<20081031224241.GD21799@artemis.corp>
In-Reply-To
<alpine.DEB.1.00.0810312334480.22125@pacific.mpi-cbg.de.mpi-cbg.de>
On Fri, Oct 31, 2008 at 10:36:58PM +0000, Johannes Schindelin wrote:
Show 20 quoted lines
> Hi,
> 
> On Fri, 31 Oct 2008, Pierre Habouzit wrote:
> 
> > git_commit_non_empty_tree is added to the functions that can be run from 
> > commit filters. Its effect is to commit only commits actually touching 
> > the tree and that are not merge points either.
> > 
> > The option --prune-empty is added. It defaults the commit-filter to
> > 'git_commit_non_empty_tree "$@"', and can be used with any other
> > combination of filters, except --commit-hook that must used
> > 'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"'
> > usually to achieve the same result.
> 
> I think that the example Sverre posted is better.  It might be a bit more 
> to write out, but at least people can adapt it to their needs (as opposed 
> to only skip "empty" commits).
> 
> However, I would _love_ to see your tests being merged with Sverre's patch 
> (of course, the tests should use the described procedure, then).

Well Sverre's example is probably the most efficient way to do the task, though the thing is right now, what one wants is rarely to "just" skip empty commits, but to do some modifications that does not leave empty commits.

IOW not doing a modification _then_ a new one, but both at the same time. Given how slow filter-branch can be, it's better to do one transformation instead of two.

Note that I don't think we should apply only my patch and not Sverre's, his proposal just made me think that this was an itch I wanted to scratch for a long time, and both probably are complementary.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Johannes SchindelinNext: Junio C Hamano
Message 13 of 25 in “git-filter-branch: Add an example on how to remove empty commits”
  1. git-filter-branch: Add an example on how to remove empty commitsPetr Baudis, Oct 30, 2008
  2. Sam VilainOct 30, 2008
  3. Johannes SchindelinOct 30, 2008
  4. Pierre HabouzitOct 30, 2008
  5. Deskin MillerOct 30, 2008
  6. Pierre HabouzitOct 30, 2008
  7. filter-branch enhancementsPierre Habouzit, Oct 30, 2008
  8. make git-filter-branch use parse-options.Pierre Habouzit, Oct 30, 2008
  9. implement --prune-empty switch for filter-branchPierre Habouzit, Oct 30, 2008
  10. Pierre HabouzitOct 31, 2008
  11. filter-branch: add git_commit_non_empty_tree and --prune-empty.Pierre Habouzit, Oct 31, 2008
  12. Johannes SchindelinOct 31, 2008
  13. Pierre HabouzitOct 31, 2008
  14. Junio C HamanoNov 3, 2008
  15. Pierre HabouzitNov 3, 2008
  16. Pierre HabouzitNov 3, 2008
  17. Jay SoffianJan 9, 2009
  18. Pierre HabouzitJan 11, 2009
  19. Johannes SchindelinJan 11, 2009
  20. Pierre HabouzitJan 11, 2009
  21. Sverre RabbelierJan 11, 2009
  22. Pierre HabouzitJan 11, 2009
  23. Sverre RabbelierJan 11, 2009
  24. Junio C HamanoJan 11, 2009
  25. Johannes SchindelinJan 11, 2009

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.