From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Storm-Olsen Subject: Re: '.git file' alternative, native (cross-platform) workdir support. Date: Fri, 29 Feb 2008 14:24:22 +0100 Message-ID: <47C80786.4070701@trolltech.com> References: <47C7FA49.9010001@trolltech.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE16C26DA41F4D72A6D5F0594" Cc: Git Mailing List , msysGit To: Johannes Schindelin X-From: git-owner@vger.kernel.org Fri Feb 29 14:25:07 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1JV5EW-0002Tg-AC for gcvg-git-2@gmane.org; Fri, 29 Feb 2008 14:25:04 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754201AbYB2NY1 (ORCPT ); Fri, 29 Feb 2008 08:24:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753470AbYB2NY1 (ORCPT ); Fri, 29 Feb 2008 08:24:27 -0500 Received: from hoat.troll.no ([62.70.27.150]:50620 "EHLO hoat.troll.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751907AbYB2NY0 (ORCPT ); Fri, 29 Feb 2008 08:24:26 -0500 Received: from localhost (localhost [127.0.0.1]) by hoat.troll.no (Postfix) with ESMTP id DA32558144; Fri, 29 Feb 2008 14:23:40 +0100 (CET) Received: from hoat.troll.no ([127.0.0.1]) by localhost (hoat.troll.no [127.0.0.1]) (amavisd-maia, port 10024) with LMTP id 16850-04; Fri, 29 Feb 2008 14:23:40 +0100 (CET) Received: from [10.3.4.215] (error.troll.no [10.3.4.215]) by hoat.troll.no (Postfix) with ESMTP id 6FE17581B0; Fri, 29 Feb 2008 14:23:40 +0100 (CET) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 In-Reply-To: X-Enigmail-Version: 0.95.6 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEXU1NTAwMABAQGsrKyE hIQwMDAEBAS8hGUfAAACQUlEQVQ4jV2TS47cMAxEKSDZW1CfwMB4PYLkrKchsveJRR2gEen+R0hR 9vziBmahhyqSRQ4NfF1FmIv3dH4usNAGoFprBVguQJmZ1nX0XiHgEukTCK3TairiZeXcVGzmZIoU 3738pehdVbiU9KFgMQWeZ1fpHZDfRS4rPb3eQVaZChGx4ikt5GDkAZQ2KKohzjklno4+iJpVhxka ZjSpasJ4gdGaEQMWTMjRa5uTqza0XDJjzhIdzGTMrqoopimoIPCKZtVOq265MAXpMLXycmVl2Y8C oE1FkT/faKauOjYoHJyOxHfvixjowvI0xZJsKykubgLYzuJMdBO+L86TjxfQ9hz9jpSudbnXXzRm tor5i3MUONpOfARAhlWbzWF7OhP2eSeEW9HUBNiHOxUM8HLWHhUAj3NZNsdqRZpNA+DJ+XlX+Qc9 Z4ZjHX8LRUzgTBBef84NQoCMOcS0+BMsj3klbTzRri03ugXr9em1GfgzDAyEn4J3fvFI5YwdTrYu 1ntAY1h5ysM2OMGm+cBOocCXHisAHu2PagnLghoG2krz8bzsA4fj7KxCGk+63jt+DDCtYjbFNkHD nRwpRqsQYx5WYzsbm/eBfn0I4TbOGvMWqhQAiEDzNs4apumCI0x2OyHtY7uAlZff/sanbH9+AGT1 KOEmUlJISdYPgEgehw+cTZEf6xeFyoEjCPgv+A62KhW3EOy9PL7WmCBMRWmfYN0OqW9krzl/Ay91 75HMqfDtP8UFckFUX2rwrm/kTVB2gH+hdu4avZVCuAAAAABJRU5ErkJggg== X-Virus-Scanned: Maia Mailguard 1.0.2a Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE16C26DA41F4D72A6D5F0594 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Johannes Schindelin said the following on 29.02.2008 13:54: > On Fri, 29 Feb 2008, Marius Storm-Olsen wrote: >> However, wouldn't simply redirecting everything into a real repo >> then create problems with shared index file and more? A problem >> which could be tacled by file suffixes or other methods, I'm >> sure, but which would require even more patches to achieve the >> goal. >=20 > Not only would it requre these patches, but it would actually make > a _safe_ multiple-workdirs feature possible. >=20 > ATM the problem is that you can change a ref that is checked out=20 > elsewhere, and if you are not a Git expert, it will just make your > life miserable. >=20 > However, if we do not pretend to have different repositories, but > actually use the _identical_ repository for multiple working > directories, we can make the mechanisms safe! >=20 > This is basically the reason why I do not like the current > new-workdir script (and the patch in my private tree where I taught > git-branch about it). >=20 > So while your approach may seem easier in the short run, there is > no way you can make it safe. No way, except going the full nine > yards, and actually use the same repository, which means that you > have to have the "other patches", too. Sure, I'm aware of that. The initial goal was to make something which=20 works as the current contrib/workdir/git-new-workdir, just=20 cross-platform. Then we can take it from there, step by step, until we=20 have something which works safely; instead of taking a single big leap. I'm actually not sure that it's impossible to make it safe. My implementation works by redirecting files into the real repo.=20 However, we can also detect when redirection is in effect, and do=20 extra 'maintainance' things then, to avoid the bad effects. For example, when setting up a workdir, we could duplicate /.git/refs/* into /.git/refs/workdir-/* ( being the sha1 of the abs path to the workdir) and have the redirection mechanism redirect all git_path("refs/*") to=20 the duplicated locations. That way, when pulling in the workdir, it=20 wouldn't create havok with the real repo's refs. Then in the real=20 repo, you can easily refer to the refs in from the workdir too, when=20 you need to. There are several possibilities here. Since file redirection works=20 from the beginning, we have a place to start, which can slowly migrate=20 into whatever. When you think about it, my approach is kinda similar=20 to the '.git file' approach, just that I don't redirect everything=20 from the start, just parts to make it work as today on Linux. In the=20 end my technique could also redirect everything into the real repo,=20 giving you the same effect as the '.git file'. --=20 =2Emarius --------------enigE16C26DA41F4D72A6D5F0594 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) iD8DBQFHyAeHKzzXl/njVP8RAuwXAKCauujt3ZPPyChgK/nXwvuLzVjZ9ACgpJfy zDm3hvXDDFBjoaBSO1fqRjA= =ZwVJ -----END PGP SIGNATURE----- --------------enigE16C26DA41F4D72A6D5F0594--