From owner-freebsd-git@freebsd.org Fri Dec 11 16:32:47 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 CEBE14B4511 for ; Fri, 11 Dec 2020 16:32:47 +0000 (UTC) (envelope-from wlosh@bsdimp.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 4CsxCg3jzqz4ZMp for ; Fri, 11 Dec 2020 16:32:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.nyi.freebsd.org (Postfix) id 7DCA04B4510; Fri, 11 Dec 2020 16:32:47 +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 7D80A4B43BD for ; Fri, 11 Dec 2020 16:32:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (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 4CsxCg28Lpz4Zcn for ; Fri, 11 Dec 2020 16:32:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf33.google.com with SMTP id az16so2335622qvb.5 for ; Fri, 11 Dec 2020 08:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T2fw1rP+SvO8gltVYW3mHpydrmwhHC7q/HYjgn5cCA4=; b=W1FhmU5o+QAwms7mfYLKQx3eyiT63nzczH4HQdbJfQCD14EXmZyMaij0penjRqe0Qs 4moGQePbr7epUl2Z6NH244v5/ZdosIxWI1G8eOFy8UEeCup83yxXP20/0td/B8JyAKQ1 gibXHCy8f6Ojxx6BsMqsLNK3dRQ7C+MlOwQcUtMArNhbJ8CnA8zj3SzXrj9EZIQ0XkmH OBY3uTU/nvSbD7QSiS4cvNZ1UKgutKaAcY59L+ZiZgeqhM5iFYFrJkSsTQrvJjGK968w bG1tMlW9/N73aANjJSqW7D6t4eCKgwRfxPhUKbKA/syOJE1mgsj7UuXe17KgAQe0rLJM eQ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T2fw1rP+SvO8gltVYW3mHpydrmwhHC7q/HYjgn5cCA4=; b=qwgwygltG3onj62AIxQdNOJkgy9addFoYK43fx8bPqGcVCfrlKrPprwMxT13DOXYBu kxvpvZNDauuBmEkDJohe1GRbOjG1TvDBP8zwlx4XYpSwO9JlxEQtsLJjSsJ3Xau/i9AV o1l9EqZE1QGaQ7wESewfxw/wRrOmfABjQWfwIjUk7ckaUBxbKpNGo6x41zcnGIKYZAh8 AiboSI9vONK0YF/BXRScvGg97FduhboA2+jpZNP+5EZnBGXNBS29/VUbUNO7/ZRb8aTw 9cpkOOE1e4hZiB7rjM+1SJI1ZIdQTMD/0kHKYVVErITzU5Rqt+cyNbx/FqI40k7mNNwd 6J4w== X-Gm-Message-State: AOAM533xacjhAhGaf/2R+svGROXNmGoPHUlmYRVg8TVs/hhTU8+4KpgT wzpaoyBRjS4aPJ95IjkvLDCp59OWHMx1vHdDKD6bm4PRtQK0Rg== X-Google-Smtp-Source: ABdhPJxmlnG2TxScN6n3YfCFfhB0BBOw6UOt4VCQiOOk0eEQwX8Jv3NoKKP1muDwN1pUObMhnPkZPMDF35VzbhNiAc0= X-Received: by 2002:a05:6214:16cb:: with SMTP id d11mr16387472qvz.62.1607704365666; Fri, 11 Dec 2020 08:32:45 -0800 (PST) MIME-Version: 1.0 References: <20201210223443.GA64504@freefall.freebsd.org> <8e48e2ea-59d8-d2fd-4e25-e12088ff3a36@gmail.com> In-Reply-To: <8e48e2ea-59d8-d2fd-4e25-e12088ff3a36@gmail.com> From: Warner Losh Date: Fri, 11 Dec 2020 09:32:34 -0700 Message-ID: Subject: Re: svnadmin equivalent? To: Marc Branchaud Cc: Konstantin Belousov , git@freebsd.org X-Rspamd-Queue-Id: 4CsxCg28Lpz4Zcn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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 16:32:47 -0000 On Fri, Dec 11, 2020 at 8:49 AM Marc Branchaud wrote: > 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 > That;s good advice. I'll add this to my FAQ. It is a bit like checking out from http://svn.freebsd.org/base, though, which gets a lot of chaff... Warner