From owner-freebsd-current@freebsd.org Tue Dec 29 18:12:42 2020 Return-Path: Delivered-To: freebsd-current@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 1A3214C723D for ; Tue, 29 Dec 2020 18:12:42 +0000 (UTC) (envelope-from madpilot@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D52Zf0Hf7z4vZ3; Tue, 29 Dec 2020 18:12:42 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from marvin.madpilot.net (host-79-12-130-69.retail.telecomitalia.it [79.12.130.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8E29E2AD63; Tue, 29 Dec 2020 18:12:41 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: git and the loss of revision numbers To: Andriy Gapon , monochrome , freebsd-current@freebsd.org References: <54116640-E6A1-4C53-9D7E-4384F942628E@ellael.org> <8ABAC674-89AA-47BE-996C-4DF6E7713F21@ellael.org> <53dd689b-2401-8e90-f332-50c60c549c2e@FreeBSD.org> <1d1e2003-0cc1-6e67-0ceb-f0fcba03f8f7@twcny.rr.com> <6a83684d-ee5b-5002-3553-7b383f02768c@nomadlogic.org> <7bfab675-ddb4-bf53-d818-d35667c74522@twcny.rr.com> <0adec2d2-acfb-9a3f-da69-aff7915ea67d@FreeBSD.org> From: Guido Falsi Message-ID: Date: Tue, 29 Dec 2020 19:12:40 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <0adec2d2-acfb-9a3f-da69-aff7915ea67d@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 18:12:42 -0000 On 29/12/20 18:38, Andriy Gapon wrote: > On 2020-12-29 17:11, monochrome wrote: >> ok, this appears to be what I was looking for >> >> example: >> git reset --hard f20c0e331 >> then: >> git pull --ff-only >> is again able to update as normal >> >> I should point out also that this is from the point of view of any >> random person just building freebsd from source, not a developer, so >> there are no local changes. Though it does blow away changes to the conf >> file, that's a lesser issue to deal with. > > git stash [save] and git stash pop can be used to try[*] to preserve > minor local changes. > > [*] there can be merge conflicts after stash pop if the same file(s) are > changed upstream as well. > Anyone who already uses git knows this, probably, but for the sake of people who have no experience with it "git stash pop" behaviour can be startling(at least, it was for me when I first used it): after a "git stash pop" which causes conflicts git will set up to actaully create a commit in the branch with the resolved conflict, which (usually for me) is not what one really wants. I usually just do "git reset; git stash drop" in this case and then fix conflicts, to leave me with no extra commits, the changes in my checkout as I want them and no stashed ones (gt does not remove the stash until you commit the resolved changes, which, as I said is not what I want to do usually) I hope I clearly explained this, and if this was obvious to everyone, sorry for the noise! -- Guido Falsi