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

Re: [PATCH] git-am: Run git gc only once and not for every patch.

From
Nicolas Pitre <nico@cam.org>
Date
Jan 4, 2008, 20:58 UTC
Message-ID
<alpine.LFD.1.00.0801041555220.2649@xanadu.home>
In-Reply-To
<477E9536.6050401@redhat.com>
On Fri, 4 Jan 2008, Michael Stefaniuc wrote:
Show 15 quoted lines
> Nicolas Pitre wrote:
> > On Fri, 4 Jan 2008, Michael Stefaniuc wrote:
> > 
> >> With "too many unreachable loose objects" git gc --auto will always
> >> trigger. This clutters the output of git am and thus git rebase.
> >>
> >> The work flow of the Wine project doesn't include git merge. git rebase
> >> is therefor used to track the origin. This will produce soon too many
> >> loose objects for git gc --auto's taste. Pruning the repository would
> >> "fix" it. But we tell Wine developers new to git to NOT prune as long as
> >> they aren't confident enough with git; just as a safety net in case they
> >> have thrown away month of work.
> > 
> > The safety is the reflog.  What it refers to doesn't get pruned.
> Then git gc --auto should just prune too and not spam, right?

Pruning might be dangerous if some other operation is happening concurrently, which is why it is not done by default.

> But the reflog is only there for branches that still exist; the rest is
> gone. A git stash clear will also remove the reflog for the stash.

But the reflog for HEAD remains nevertheless, and it contains everything that happened to be the current branch.

> Regardless of the safety of git prune i don't see a reason why git gc
> --auto needs to be called for every patch in a git-am run and not once
> at the end.
Indeed.
Nicolas
Previous: Michael StefaniucNext: Junio C Hamano
Message 4 of 9 in “git-am: Run git gc only once and not for every patch.”
  1. git-am: Run git gc only once and not for every patch.Michael Stefaniuc, Jan 4, 2008
  2. Nicolas PitreJan 4, 2008
  3. Michael StefaniucJan 4, 2008
  4. Nicolas PitreJan 4, 2008
  5. Junio C HamanoJan 4, 2008
  6. Michael StefaniucJan 4, 2008
  7. Junio C HamanoJan 4, 2008
  8. Junio C HamanoJan 5, 2008
  9. Michael StefaniucJan 5, 2008

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.