/** * Whether to use aggressive mode or not. If set to true JGit behaves more * similar to native git's "git gc --aggressive". If set to * <code>true</code> compressed objects found in old packs are not reused * but every object is compressed again. Configuration variables * pack.window and pack.depth are set to 250 for this GC. * * @since 3.6 * @param aggressive * whether to turn on or off aggressive mode * @return this instance */ public GarbageCollectCommand setAggressive(boolean aggressive) { if (aggressive) { StoredConfig repoConfig = repo.getConfig(); pconfig.setDeltaSearchWindowSize(repoConfig.getInt( ConfigConstants.CONFIG_GC_SECTION, ConfigConstants.CONFIG_KEY_AGGRESSIVE_WINDOW, DEFAULT_GC_AGGRESSIVE_WINDOW)); pconfig.setMaxDeltaDepth(repoConfig.getInt( ConfigConstants.CONFIG_GC_SECTION, ConfigConstants.CONFIG_KEY_AGGRESSIVE_DEPTH, DEFAULT_GC_AGGRESSIVE_DEPTH)); pconfig.setReuseObjects(false); } else pconfig = new PackConfig(repo); return this; }
pc.setDeltaCompress(false); pc.setReuseDeltas(true); pc.setReuseObjects(true);
private void packGarbage(ProgressMonitor pm) throws IOException { PackConfig cfg = new PackConfig(packConfig); cfg.setReuseDeltas(true); cfg.setReuseObjects(true); cfg.setDeltaCompress(false); cfg.setBuildBitmaps(false);
/** * Whether to use aggressive mode or not. If set to true JGit behaves more * similar to native git's "git gc --aggressive". If set to * <code>true</code> compressed objects found in old packs are not reused * but every object is compressed again. Configuration variables * pack.window and pack.depth are set to 250 for this GC. * * @since 3.6 * @param aggressive * whether to turn on or off aggressive mode * @return this instance */ public GarbageCollectCommand setAggressive(boolean aggressive) { if (aggressive) { StoredConfig repoConfig = repo.getConfig(); pconfig.setDeltaSearchWindowSize(repoConfig.getInt( ConfigConstants.CONFIG_GC_SECTION, ConfigConstants.CONFIG_KEY_AGGRESSIVE_WINDOW, DEFAULT_GC_AGGRESSIVE_WINDOW)); pconfig.setMaxDeltaDepth(repoConfig.getInt( ConfigConstants.CONFIG_GC_SECTION, ConfigConstants.CONFIG_KEY_AGGRESSIVE_DEPTH, DEFAULT_GC_AGGRESSIVE_DEPTH)); pconfig.setReuseObjects(false); } else pconfig = new PackConfig(repo); return this; }
/** * Whether to use aggressive mode or not. If set to true JGit behaves more * similar to native git's "git gc --aggressive". If set to * <code>true</code> compressed objects found in old packs are not reused * but every object is compressed again. Configuration variables * pack.window and pack.depth are set to 250 for this GC. * * @since 3.6 * @param aggressive * whether to turn on or off aggressive mode * @return this instance */ public GarbageCollectCommand setAggressive(boolean aggressive) { if (aggressive) { StoredConfig repoConfig = repo.getConfig(); pconfig.setDeltaSearchWindowSize(repoConfig.getInt( ConfigConstants.CONFIG_GC_SECTION, ConfigConstants.CONFIG_KEY_AGGRESSIVE_WINDOW, DEFAULT_GC_AGGRESSIVE_WINDOW)); pconfig.setMaxDeltaDepth(repoConfig.getInt( ConfigConstants.CONFIG_GC_SECTION, ConfigConstants.CONFIG_KEY_AGGRESSIVE_DEPTH, DEFAULT_GC_AGGRESSIVE_DEPTH)); pconfig.setReuseObjects(false); } else pconfig = new PackConfig(repo); return this; }
setReuseObjects( rc.getBoolean("pack", "reuseobjects", isReuseObjects())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaCompress(
pc.setDeltaCompress(false); pc.setReuseDeltas(true); pc.setReuseObjects(true);
pc.setDeltaCompress(false); pc.setReuseDeltas(true); pc.setReuseObjects(true);
private void packGarbage(ProgressMonitor pm) throws IOException { PackConfig cfg = new PackConfig(packConfig); cfg.setReuseDeltas(true); cfg.setReuseObjects(true); cfg.setDeltaCompress(false); cfg.setBuildBitmaps(false); try (PackWriter pw = new PackWriter(cfg, ctx); RevWalk pool = new RevWalk(ctx)) { pw.setDeltaBaseAsOffset(true); pw.setReuseDeltaCommits(true); pm.beginTask(JGitText.get().findingGarbage, objectsBefore()); for (DfsPackFile oldPack : packsBefore) { PackIndex oldIdx = oldPack.getPackIndex(ctx); for (PackIndex.MutableEntry ent : oldIdx) { pm.update(1); ObjectId id = ent.toObjectId(); if (pool.lookupOrNull(id) != null || anyPackHas(id)) continue; int type = oldPack.getObjectType(ctx, ent.getOffset()); pw.addObject(pool.lookupAny(id, type)); } } pm.endTask(); if (0 < pw.getObjectCount()) writePack(UNREACHABLE_GARBAGE, pw, pm); } }
private void packGarbage(ProgressMonitor pm) throws IOException { PackConfig cfg = new PackConfig(packConfig); cfg.setReuseDeltas(true); cfg.setReuseObjects(true); cfg.setDeltaCompress(false); cfg.setBuildBitmaps(false);
setReuseObjects( rc.getBoolean("pack", "reuseobjects", isReuseObjects())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaCompress(
setReuseObjects( rc.getBoolean("pack", "reuseobjects", isReuseObjects())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaCompress(