From owner-freebsd-git@freebsd.org Fri Dec 11 18:13:34 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 B27684B6DFA for ; Fri, 11 Dec 2020 18:13:34 +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 4CszRy3Qtjz4jHY for ; Fri, 11 Dec 2020 18:13:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.nyi.freebsd.org (Postfix) id 757954B6DF9; Fri, 11 Dec 2020 18:13:34 +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 73A8D4B69C5 for ; Fri, 11 Dec 2020 18:13:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (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 4CszRx3vm2z4jFM for ; Fri, 11 Dec 2020 18:13:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id z188so9288258qke.9 for ; Fri, 11 Dec 2020 10:13:33 -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=aFuSKz/O9lKj4LBuhIbxgczkVqggh0uoZn6LgYvFJGQ=; b=rnev0kiHkULq43UAcE0AU9t/1j4LneAnScwhIQYMiShupInGVR8/o5LlSIaCV++07i vuQuc9ptfRaF/6mlnq4u2GnqWOpzJ3RP7Pkzd5E+OVZnD8XIhX+/3rLMgEvEO5JfX0ZI ZGp1UlGGVKNdAb+3xudnnLrS4XMPKzsWwrenm9Kn1DxNPNO2y1yL3bt57CH/WECp0lM8 fl9dCe5JuFYJ5CTl7xXMcZMsCiLkpWcmdIjwg+og1Dx8BAaOSpm8mPGOMMj0wsoZqMm7 +wWtEqxk04XFSMalI51XQ+rydEPAdRXX6mWoACUjgrqRcaIlFKWlW8JoUHWi1Xd5akaF 0Yng== 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=aFuSKz/O9lKj4LBuhIbxgczkVqggh0uoZn6LgYvFJGQ=; b=pj1SPBjIU/jsGRCoQk7hriP7clkO98NSc/yLlX0iygwZuSvCfIzYVixDjk31nuQmBX oNEFKdRjYyD7fzE15LoQEgZgQrYy2t/43rQGKU1O3myIN5XJoodHua6er76UvRXHg998 A+aY6mq4v7/QhuT1XZA/4T4yKJZjyUepw+TBdDvttw1Orwy7shzPDbCJ1y9DNnQ5Y0bO B6WgfZ7X/8pWoWkov4sFwq2lrNOQ62WPp5H6RwE+cO5Psk4so3xI/cBK0slomZwlMaLA EeU0SRZmV8rm4JHI/R1gebxkeFS/5WtsyInaQ4jx6hmtT72xqADIB9vuQcnnycIPSWTe xLZg== X-Gm-Message-State: AOAM53293ItP3XDti7+J6JnStexmOC+eHcgNvf6kdQDsJWkBoEjoBO59 cQEuVUDIDl4UgyaCSyUA25qJ30LZuk7i4HuMvAm81GbcSWXTx7a4 X-Google-Smtp-Source: ABdhPJy1Gz+SNPd8zFHRyCth86t0lJoDW4AqUIYeaUROGuRmIV9a7mqq96WxMepKZffrMTVKMYPQE8r6YgirJNpFz+E= X-Received: by 2002:a37:a614:: with SMTP id p20mr17277829qke.359.1607710412388; Fri, 11 Dec 2020 10:13:32 -0800 (PST) MIME-Version: 1.0 References: <20201210223443.GA64504@freefall.freebsd.org> <8e48e2ea-59d8-d2fd-4e25-e12088ff3a36@gmail.com> In-Reply-To: From: Warner Losh Date: Fri, 11 Dec 2020 11:13:20 -0700 Message-ID: Subject: Re: svnadmin equivalent? To: Marc Branchaud Cc: Konstantin Belousov , git@freebsd.org X-Rspamd-Queue-Id: 4CszRx3vm2z4jFM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=rnev0kiH; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::729) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [0.00 / 15.00]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.999]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; SUBJECT_ENDS_QUESTION(1.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::729:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[git@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::729:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::729:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[git]; RCVD_COUNT_TWO(0.00)[2] 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 18:13:34 -0000 Hi Marc Thanks for the detailed explanation. I've updated https://github.com/bsdimp/freebsd-git-docs/blob/main/faq.md to include details discussed here. Please let me know if I've missed anything, or if I've botched something. BTW, I wasn't sure why you needed to reset the default first. Most people will have that or just that an the notes. There's no reason you can't add this too that I can see, but maybe I'm overlooking something. Warner On Fri, Dec 11, 2020 at 9:32 AM Warner Losh wrote: > > > 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 >