Как пропустить “Свободный Объект”, раскрываются когда рабочий 'мерзавец gui'

легко генерировать прокси от интерфейсов.

при рассмотрении какого-либо пружинного приложения Вы будете видеть интерфейсы персистентности и сервис. создание, что пружинная идиома, конечно, поощряет использование интерфейсов. это больше не становится явным, чем это.

115
задан JJD 2 January 2012 в 13:04
поделиться

3 ответа

Update: git prune would "solve" the issue, in that it will remove those loose objects
(git gc calls git prune, but only for loose objects older than two weeks, by default).
However, as the OP Michael Donohue mentions in the comments:

I do like the safety aspect of keeping the loose objects around for two weeks, should I want to go back and look at some old revisions, so I don't really like this solution.
I am not having any trouble with the size or performance of git, it is just 'git gui' that insists on asking me to compress the database, even when compressing the database would have no effect.


Original answer:

The problem of "git gc" not removing all loose objects has been reported before (late 2008, ""git gc" doesn't seem to remove loose objects any more"

git gc only removes loose objects older than two weeks, if you really want to remove them now, run git prune.
But make sure no other git process can be active when you run it, or it could possibly step on something.

"git gc" will unpack objects that have become unreachable and were currently in packs.
As a result, the amount of disk space used by a git repository can actually go up dramatically after a "git gc" operation, which could be surprising for someone who is running close to full on their filesystem, deletes a number of branches from a tracking repository, and then does a "git gc" may get a very unpleasant surprise.

[Example:] Old branches are reserved via a tag such as next-20081204.
If you update the your local copy of the linux-next repository every day, you will accumulate a large number of these old branch tags.
If you then delete a whole series of them, and run git-gc, the operation will take quite a while, and the number of blocks and inodes used will grow significantly.

They will disappear after a "git prune", but when I do this housekeeping operation, I've often wished for a --yes-I-know-what-I-am-doing-and-it's-unsafe-but-just-drop-the-unreachable-objects-cause-this-is-just-a-tracking-repository option to "git gc".

So in your case, would a "git prune" be helpful?

(possibly with using "now" in the gc.pruneexpire config variable, needed for the above behavior to happen).


You also have (from the same thread):

repack -a -d -l

Notice the lowercase 'a'.

git-gc calls repack with uppercase 'A' which is what causes the unreachable objects to be unpacked. Little 'a', is for people who know what they are doing, and want git to just drop unreachable objects.

48
ответ дан 24 November 2019 в 02:23
поделиться

Когда появляется всплывающее окно «Свободный объект», я знаю, что пора запускать сборщик мусора git:

git gc

После этого всплывающее окно исчезает.

Обновление: (по предложению TED)

Я извлек следующую процедуру из git / share / git-gui / lib / database.tcl
Вы можете изменить ее в соответствии со своими потребностями.

proc hint_gc {} {
    set object_limit 8
    if {[is_Windows]} {
        set object_limit 1
    }

    set objects_current [llength [glob \
        -directory [gitdir objects 42] \
        -nocomplain \
        -tails \
        -- \
        *]]

    if {$objects_current >= $object_limit} {
        set objects_current [expr {$objects_current * 256}]
        set object_limit    [expr {$object_limit    * 256}]
        if {[ask_popup \
            [mc "This repository currently has approximately %i loose objects.

To maintain optimal performance it is strongly recommended that you compress the database when more than %i loose objects exist.

Compress the database now?" $objects_current $object_limit]] eq yes} {
            do_gc
        }
    }
}
30
ответ дан 24 November 2019 в 02:23
поделиться

Хммм .... Я не вижу аргумента командной строки для этого в документах .

Я полагаю, вы всегда можете загрузить его исходный код, вынуть код для диалога и перестроить .

3
ответ дан 24 November 2019 в 02:23
поделиться
Другие вопросы по тегам:

Похожие вопросы: