git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Langhoff <martin@catalyst.net.nz>
To: git@vger.kernel.org
Cc: Martin Langhoff <martin@catalyst.net.nz>
Subject: [RFC] git-fetch - repack in the background after fetching
Date: Tue, 30 May 2006 16:42:43 +1200	[thread overview]
Message-ID: <11489641631558-git-send-email-martin@catalyst.net.nz> (raw)

Check whether we have a large set of unpacked objects and repack
after the fetch, but don't for the user to wait for us.

---

There's been some discussion about repacking proactively without
preventing further work. But as Linus said, repacking on an active
repo is _safe_, so repack in the background. 

If we like this approach, we should at least respect a git-repo-config
entry saying core.noautorepack for users who don't want it. I don't
really know if there is any convention for us to check if we are in
a resource-constrained situation (aka laptops on battery). If there
is, we should respect that as well. I suspect anacron and others 
do this already but I can't find any references.

We can potentially do it on commit, merge and push as well. 
---

 git-fetch.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

5498d015eb1062928a504af3c6b3cb9b776088e8
diff --git a/git-fetch.sh b/git-fetch.sh
index 69bd810..4d64cdb 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -424,3 +424,9 @@ case ",$update_head_ok,$orig_head," in
 	fi
 	;;
 esac
+
+if test $(git rev-list --unpacked --all | wc -l) -gt 1000
+then
+	echo "Repacking in the background"
+	nice git repack -a -d -q &
+fi
-- 
1.3.2.g82000

             reply	other threads:[~2006-05-30  4:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-30  4:42 Martin Langhoff [this message]
2006-05-30  4:51 ` [RFC] git-fetch - repack in the background after fetching Linus Torvalds
2006-05-30  5:14   ` Martin Langhoff
2006-05-30  6:37   ` Daniel Barkalow
2006-05-30 14:53     ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2006-06-24 11:30 Martin Langhoff
2006-06-25  3:12 ` Junio C Hamano
2006-06-25  3:53 ` Linus Torvalds
2006-06-25  9:25   ` Johannes Schindelin
2006-06-25 17:29     ` Linus Torvalds
2006-06-25 17:53 linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11489641631558-git-send-email-martin@catalyst.net.nz \
    --to=martin@catalyst.net.nz \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).