Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 306545

Summary: git.eclass and clones being both shallow and bare
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: EclassesAssignee: Tomáš Chvátal (RETIRED) <scarabeus>
Status: RESOLVED CANTFIX    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: The patch to git.eclass
Small fix

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-02-23 17:33:56 UTC
The current code for dealing with git bare repository cloning does doesn't play nice with shallow copies. Moreover, it lacks a '|| die' to the 'git clone' command.

I've created a simple proof-of-concept patch which allows git to deal fine with clones being both shallow and bare at the same time but I'm not sure whether it the correct approach.

It replaces the 'git clone' approach with rsyncing the bare copy into '.git' subdirectory of ${S}, and then uses 'git init' to reinit the repo (it is required for git to work with it) and 'git checkout' to get the required files.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-02-23 17:34:40 UTC
Created attachment 220867 [details, diff]
The patch to git.eclass
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-02-24 12:10:05 UTC
Created attachment 220963 [details, diff]
Small fix
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-06-04 07:51:05 UTC
Well, now I think shallow clones are useless after all. On first update, git fetches a lot of data after all -- and using them is really annoying. Thus, I think you might reject the bug.