[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-scm-interest
Subject:    [Kde-scm-interest] Re: git filter-branch preserving history
From:       "Boyd Stephen Smith Jr." <bss () iguanasuicide ! net>
Date:       2010-11-19 20:04:15
Message-ID: 201011191404.21149.bss () iguanasuicide ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


In <201011192001.20255.kde@arnorehn.de>, Arno Rehn wrote:
>we're currently experimenting how to best convert kdebindings to git. One
>thing that we tried was 'git filter-branch --subdirectory-filter ruby -- --
>all' to remove everything but the 'ruby' subdir and make this the top-level
>directory. The resulting directory structure looked good, but strangely the
>history of all other unrelated subdirs was left intact, even after git gc --
>aggressive and git prune.
>So the resultung repository wasn't any smaller than the original monolithic
>kdebindings thing, even though there was only a small subdir left.

You probably just didn't try hard enough to lose the objects.  The "--
aggressive" option to gc doesn't shrink the pruning window, it "simply" 
adjusts the packing done.  You didn't mention if you removed the backup refs 
created by filter-branch.  You also didn't mention if you manually cleaned the 
reflogs; normally even "broken" reflogs are retained for 30 days, and it may 
be that reflogs can keep objects alive.

Here's some steps for cleanup:
1. Delete all the backup refs created by filter-branch under refs/original. 
(rm -r .git/refs/original)
2. Expire reflogs that point to pre-filtered commits and all other objects 
unreachable from the current tips. (git reflog --expire --expire-
unreachable=now --all)
3. Repack the repository and leave any pre-filter object (or otherwise 
unreachable objects) as an unpacked object; remove redundant packs. (git 
repack -A -d)
4. Prune all loose objects that only existed in pre-filtered commits, which 
should be all the unpacked objects and nothing in a pack. (git prune --expire 
now)

(git gc --aggresive) uses "30 days" by default in step 2 instead of my "now".  
It also uses "2 weeks ago" by default in step 4 instead of my "now".

So, if reflogs can keep objects alive, your repository would have started 
shrinking in about 30 days.  If reflogs can't keep objects alive, your 
repository would have started shrinking in about 2 weeks.

HTH
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

["signature.asc" (application/pgp-signature)]

_______________________________________________
Kde-scm-interest mailing list
Kde-scm-interest@kde.org
https://mail.kde.org/mailman/listinfo/kde-scm-interest


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic