From owner-freebsd-git@freebsd.org Fri Dec 11 15:49:08 2020 Return-Path: Delivered-To: freebsd-git@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D55254B30E4 for ; Fri, 11 Dec 2020 15:49:08 +0000 (UTC) (envelope-from marcnarc@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4CswFJ4YNcz4WHy for ; Fri, 11 Dec 2020 15:49:08 +0000 (UTC) (envelope-from marcnarc@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 9A3424B30E3; Fri, 11 Dec 2020 15:49:08 +0000 (UTC) Delivered-To: git@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99F3F4B3184 for ; Fri, 11 Dec 2020 15:49:08 +0000 (UTC) (envelope-from marcnarc@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CswFJ3kbCz4WS0 for ; Fri, 11 Dec 2020 15:49:08 +0000 (UTC) (envelope-from marcnarc@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id q22so8797857qkq.6 for ; Fri, 11 Dec 2020 07:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=94/j7mCAvbG4NFrh0GQ/aw88Z0tawM1kbOBNi5+ft5A=; b=ACSml6FQXbkWKXdgKOpu76NXqHnu4ef2Jr0buA3f9/uckQmspiR40LLjic/kBcypnV BjRSNVm5Ow+p8POmHprosa40Erl8dAvd7l44GuIGoVXcp6xkIAwODiFA0iGl3PAOWViE xFr2z7s3s8OBnRSHnjiOi6tF9E0PMOUYBysQELkCEfnu/bp45QonDEFsHklksR7hYxGm ZDEERosrN2AcEdz72JnkkYg2nHUSCw7AtUseI4RgiNs5O1WHZXmwDH2hPw4wBqHCZZkI QYQTxoumcB3MlqTQr6vQBGsCsRsGTX6ctoVJEYVwg2r2zLisii4ms0mxpAiYPDS0Dh4T i0eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=94/j7mCAvbG4NFrh0GQ/aw88Z0tawM1kbOBNi5+ft5A=; b=ajitrkHDGK+EyAMTEhfRH6CDSKqOdyTlTpF55mgEqBHeRGiqqdHmeoTX5QCjfA3OxG 1lnS1XIbHvY5AyiVbDobDFjkj0mhkeovkUy0P+7VGB+dhsZAg6QeowMjTIE03RJiv6sW +LIYIyUnm2GCzLmfrfmGGLXPlFPfjhBqREinb/MsuFrsdt72l2dOEyfbgzrjknHmP37Z exwbDnt2LF7HejUYGZcu8MtUE7ETjnaXKe4JB6jryfAqvxztSgI9verTeTeOTgDBj9/Q vaBezuacIEhJJdi1qopdTa83XFI17OT7idrClmBybcN61IUHGBquf+5S4Arr7YJA7LkS Bguw== X-Gm-Message-State: AOAM531OceaPHOk2kgaKkOAWIImSyE0P+XOIkkNqjI+gtJefuh8If0rF NdR+xnEg7qSdCCH2195xxow= X-Google-Smtp-Source: ABdhPJwnk1I5wBVjMSFADMZtlN52JjcGXaPAucLkdpOZtGMppjpY0hJNEReCjHo2OH0fBesxY/xWFA== X-Received: by 2002:a05:620a:6a1:: with SMTP id i1mr17092784qkh.136.1607701747687; Fri, 11 Dec 2020 07:49:07 -0800 (PST) Received: from [192.168.222.18] (192-222-183-158.qc.cable.ebox.net. [192.222.183.158]) by smtp.gmail.com with ESMTPSA id n81sm7028835qka.76.2020.12.11.07.49.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Dec 2020 07:49:06 -0800 (PST) Subject: Re: svnadmin equivalent? To: Warner Losh , Konstantin Belousov Cc: git@freebsd.org References: <20201210223443.GA64504@freefall.freebsd.org> From: Marc Branchaud Message-ID: <8e48e2ea-59d8-d2fd-4e25-e12088ff3a36@gmail.com> Date: Fri, 11 Dec 2020 10:49:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CswFJ3kbCz4WS0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 15:49:08 -0000 On 2020-12-10 11:37 p.m., Warner Losh wrote: > On Thu, Dec 10, 2020, 9:35 PM Konstantin Belousov > wrote: >> >> Can we have it scripted, per repo, and scripts available somewhere ? >> It is convoluted list of per-repo branches. I want a simple means to >> run something and get the guaranteed clone of all material from the repo. >> > > git clone --mirror "git clone --mirror" fetches everything, but it has two potentially confusing side-effects: * Mirroring creates a "bare" local repository without any checked-out files (all you get are the contents of the remote's .git/ directory). This doesn't mean it's unusable, just that it's not *directly* usable (for example, see Mathieu's suggestion about "git worktree add"). * More subtly, mirroring also removes the distinction between your local branches and the remote repo's branches. So you don't end up with any "origin/XXXX" branches. This can be very confusing when you've made commits to your local "main" branch that get clobbered by your next fetch. Here's how to get absolutely everything in your regular-clone'd repo while preserving the "origin/" namespace for the official repo's branches: # First reset the config to the default that a non-mirror clone creates: git config --replace-all remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' (WARNING: If you've configured other remote.origin.fetch specs, like to retrieve the "notes" namespace, this command will remove those and you'll have to re-configure them.) # Then configure fetch to also get all the other stuff: git config --add remote.origin.fetch '+refs/*:refs/origin/*' The default setting is important to make commands that interpret branch names work properly with remote ("origin/") branches, because they look for remote branch names under the refs/remotes/ namespace. The second setting puts *every* reference in the remote repo into your repo's "refs/origin/" namespace. Since nothing in git uses the "refs/origin/" namespace we're free to do whatever we want with it without breaking anything. The slight inconvenience is that to access a non-branch, non-tag symbol we have to prefix it with "refs/origin/" (not just "origin/"): git show refs/origin/internal/admin:mentors git log refs/origin/vendor/zlib/1.2.10 git checkout -b my-arm64-hacks refs/origin/projects/arm64 M.