From owner-freebsd-git@freebsd.org Sun May 2 10:48:10 2021 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 C3FDA621325 for ; Sun, 2 May 2021 10:48:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FY2rV52vHz4Y4m for ; Sun, 2 May 2021 10:48:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id AD2D6621324; Sun, 2 May 2021 10:48:10 +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 ACF4B5FFEDC for ; Sun, 2 May 2021 10:48:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FY2rV4SQPz4Y0G; Sun, 2 May 2021 10:48:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 5E636B6DB; Sun, 2 May 2021 10:48:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (unknown [IPv6:2001:470:7a58:0:e0d3:13d5:7e22:8d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A09965AB1A; Sun, 2 May 2021 12:48:08 +0200 (CEST) From: Dimitry Andric Message-Id: <1F752FD8-BD49-4BE2-BABE-DDB28BC3CF9A@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_7D90F677-C7FC-4B82-A714-B9F5B49DC0A3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: Ports tree have been migrated to git Date: Sun, 2 May 2021 12:47:54 +0200 In-Reply-To: Cc: git@freebsd.org To: Kurt Jaeger References: <1772D08D-CE66-4285-B8EE-2A353E7B91E2@FreeBSD.org> X-Mailer: Apple Mail (2.3654.80.0.2.43) 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: Sun, 02 May 2021 10:48:10 -0000 --Apple-Mail=_7D90F677-C7FC-4B82-A714-B9F5B49DC0A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 2 May 2021, at 08:48, Kurt Jaeger wrote: >=20 >>> # git checkout origin/main >>> error: The following untracked working tree files would be = overwritten by checkout: >>> multimedia/transcode/files/patch-import_demux__pass.c >>> multimedia/transcode/files/patch-import_extract__ac3.c >>> multimedia/transcode/files/patch-import_extract__mp3.c >>> multimedia/transcode/files/patch-import_extract__pcm.c >>> [...] >>> Please move or remove them before you switch branches. >>> [...] >>=20 >> Ah yes, I was assuming that you were starting with a clean tree. In = this >> case you could have used "git stash" to stash away the changes, and = get >> them back later. >=20 > # git stash > No local changes to save Yes, this is because you manually got rid of those files. Normally, if you have several outstanding changes in your working copy, you use "git stash" (the full command is actually "git stash push") to stash away those changes. Then you can do stuff like pulling, merging or whatever you like, and finally you do a "git stash pop" to get your outstanding changes back. For instance, if you are working on some patch, and somebody in your team says "I've pushed a fix, please pull", you would typically do: git stash git pull git stash pop >>> Ok, I deleted those, but then >>>=20 >>> git show >>>=20 >>> shows me details of > [...] >>> $ git branch -d main >>> error: Cannot delete branch 'main' checked out at = '/pou/ports/default' >>> $ git branch -D main >>> error: Cannot delete branch 'main' checked out at = '/pou/ports/default' >>=20 >> That means you are using worktrees, so indeed then you cannot delete = the >> main branch, as that other location is using it. >=20 > I was not aware that I use a worktree, but this is the list of = worktrees > in use: >=20 > # git worktree list > /pou/ports/default 7e1519526 [main] Ah, I think that what happened is that your initial "git checkout origin/main" failed because of your untracked files, and then you did not repeat the "git checkout origin/main" after getting rid of those files? In that case, the local 'main' branch was still checked out in your one-and-only working tree, which is why it cannot be deleted, at that point. (Unfortunately it is not easy to give git "recipes" that work in any and all situations, as local changes can influence what git will do. Here, I was assuming you had a clean working area, which was not the case.) > $ git show > #ommit dc5a6492de7a0b3e79d48a02f4678c5af4467e40 (HEAD -> main, = origin/main, origin/HEAD) > [...] > Again I expected that 'git show' does not display anything, as > I should be in the state of a pristine repo without anything > to show ? "git show" without any further arguments does not show the current changes in your working tree, but the contents of HEAD. Usually that is the last commit on the branch that you have checked out. If you want to see an overview of changes you have done in your current working tree, use "git status" instead. -Dimitry --Apple-Mail=_7D90F677-C7FC-4B82-A714-B9F5B49DC0A3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYI6DWgAKCRCwXqMKLiCW oxHAAJ9Eek2lGZqWOlu6TIjky8pXb+GBJQCdHrB262iaTEk1kwPD+sm2cgwk/LY= =AvPh -----END PGP SIGNATURE----- --Apple-Mail=_7D90F677-C7FC-4B82-A714-B9F5B49DC0A3--