From owner-svn-src-all@freebsd.org Fri Dec 23 18:36:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ED99C8C0E1 for ; Fri, 23 Dec 2016 18:36:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495DA10C0 for ; Fri, 23 Dec 2016 18:36:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x244.google.com with SMTP id b123so25203002itb.2 for ; Fri, 23 Dec 2016 10:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IbQo8UOhjyWPG3k63Z3qwa7YANX/0IiYRrkc2C6daDk=; b=hjuGXVSM2l2bG+VMTiK3FUhbZ3ElppmfGugM8WJ9t11R4cd9b+3dcwT9oi0gsbgRso zcnZg2mhgsl2m8SARnr3kusoSFEGu0WlIqH5BChowV2Vh0GtBzpYDAKM9wcIzAS5hnTo xONvN1JPRwiTESRpYFEWneNP/986oH2hdxxMi6YsA2bSFzk67DteY39tMG6kxUiFfdWa l+qPRenttyp5FrhLG6fk2xkpGuyWe29Ao+KhL83Vtb7p4cGa7Ei/IdckPBa0y7ZFUhEd gsTz9j5cHbR8KwEhoR+zaRFJpCQJEuheVFu5U04eyXREXAfQoh9+veBcTrU62OP7E2ww vIeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IbQo8UOhjyWPG3k63Z3qwa7YANX/0IiYRrkc2C6daDk=; b=HmtdEMlFgw5tKDyiiEgySHDEGVaLbb+vM8/L0bVpP2MiNUsfD/oKim6ANGraORJq3S t12UCKRM5KjANSfem0s9v/3rbwaCqSGd6Ef8uVbTMEnc9j5P1xx9a1tIQEuPaOrNgC6l /TCK1QAFHtNZtcKU6xHeY8rxPCiO00EOKP57bEU1lyzqhYIhcBH/RORnQ8dqzkMlNjQi DTto5cxpGvfLyXX9/UFkiSGjt324pP/mFCs4Av3it+JKQloIWaM6s8rDZ70cAHJQ6VPg pglvXVmINJox7uKDN6Nj0J7X4MVlvARni/ew14ue9JxDQPiSEkjIJgGqBSG1lvm6XEn4 CZyg== X-Gm-Message-State: AIkVDXKC0YtyeMJmWrH+sIV6XiPtoRos/MCd/4cFqc0Fz1AxIp1mqbOYOLh7eXGAB97oUvToVq+8silpM70bkQ== X-Received: by 10.36.200.68 with SMTP id w65mr16823524itf.85.1482518177362; Fri, 23 Dec 2016 10:36:17 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.22.135 with HTTP; Fri, 23 Dec 2016 10:36:16 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201611180013.uAI0DU57087971@repo.freebsd.org> From: Warner Losh Date: Fri, 23 Dec 2016 11:36:16 -0700 X-Google-Sender-Auth: MO1wesfYsL7T0phbHCaiKCKkLRE Message-ID: Subject: Re: svn commit: r308789 - head/sys/conf To: Ed Maste Cc: Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 18:36:18 -0000 On Fri, Dec 23, 2016 at 9:35 AM, Ed Maste wrote: > On 17 November 2016 at 19:13, Gleb Smirnoff wrote: >> Author: glebius >> Date: Fri Nov 18 00:13:30 2016 >> New Revision: 308789 >> URL: https://svnweb.freebsd.org/changeset/base/308789 >> >> Log: >> If FreeBSD source tree is a subproject of a bigger project, then .git or >> .hg may reside above FreeBSD sources root. Provide function findvcs() >> that will climb up and seek for presence of a VCS directory. > > This can incorrectly find an unrelated .git directory and provide a > git revision unrelated to the FreeBSD source being built. For example, > a build from my Subversion tree now reports "FreeBSD 12.0-CURRENT #2 > ad3f46a(master)" instead of "FreeBSD 12.0-CURRENT #5 r310482M". > > Can you explain your use case in a little more detail so that I can > avoid breaking it with a change here? Do you commit FreeBSD snapshots > into the "bigger project"? This is done at work (Netflix). We import all the FreeBSD revisions from github into our repo, and then merge them into the top level FreeBSD directory from time to time using git's subtree functionality. We also pull in our ports tree this way (so we have a ports directory at the same level as our FreeBSD directory). So we don't have a $TOPSRC/.git like you would if you'd just cloned directly from github. Our .git directory lives in $TOPSRC/.git as a result. newvers.sh should find the 'deepest' SCM it can, and use that instead of apparently using the topmost (I'm surprised that you have FreeBSD under a directory that has a git checkout in it, btw, but I know that with my dotfile management repo, that sometimes happens by mistake). And if this somehow produces a 'tie', the tie should go to svn. Looking at how to fix this mess... woof. There's all kinds of crazy here. Support for: git, git + svn, hg, p4, svn and svnlite. Sometimes $VCS_cmd is defined if it exists at all on the system, other times it's only defined if it exists on the system AND we think the tree is under $VCS. But the base of all this woe is that findvcs is called on a per-vcs basis, rather than being called early to match one of N VCS signatures. It would be better off searching each directory for each file rather than finding any file at any level. Warner