Re: [PATCH v3 0/8] Hiding refs
- From
Jed Brown <jed@59a2.org>
- Date
- Feb 10, 2013, 04:45 UTC
- Message-ID
- <87y5ew6alp.fsf@59A2.org>
- In-Reply-To
- <7v38x5ul4s.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> I am not sure about "pushing" part, but the jc/fetch-raw-sha1 topic > (split from the main jc/hidden-refs topic) should allow your script, > after the client learns the set of smudged object names, to ask for > > git fetch $there $sha1_1 $sha1_2 ...
Well, my out-of-band knowledge is currently the sha1 of the data contained in the blob I want, not the blob sha1 itself [1]. After experimenting with jc/hidden-refs, I think it already does exactly what I want. Specifically, I set this on the server
git config uploadpack.hiderefs refs/fat
so that 'git ls-remote' no longer transfers these refs. Then on the client, I do
contentid=$(sha1sum thefile | cut -f1 -d \ ) blobid=$(git hash-object -w thefile) git update-ref refs/fat/$contentid $blobid
.... more like this
git push the-remote refs/fat/$contentid ...
and later, I can fetch specific refs using
git fetch the-remote refs/fat/$wanted:refs/fat/$wanted ...
The client knows the desired refs out-of-band so this looks okay. It would be convenient to have '--stdin' options to 'git push' and 'git fetch'. Would a patch for that be welcome?
[1] The reason for using $contentid instead of $blobid in the key here is to avoid etching the backend=git detail into the cleaned commits.