From nobody Thu Oct 19 22:37:52 2023 X-Original-To: freebsd-git@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SBN036PrBz4xxd7 for ; Thu, 19 Oct 2023 22:37:55 +0000 (UTC) (envelope-from marcnarc@gmail.com) Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SBN030g7Qz4W8V for ; Thu, 19 Oct 2023 22:37:55 +0000 (UTC) (envelope-from marcnarc@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=mz3FIZaC; spf=pass (mx1.freebsd.org: domain of marcnarc@gmail.com designates 2607:f8b0:4864:20::22c as permitted sender) smtp.mailfrom=marcnarc@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b2e73a17a0so166172b6e.3 for ; Thu, 19 Oct 2023 15:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697755074; x=1698359874; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fYRhWwDjISXm74qste3qKRlk+PEfcKkBEn/W5v18Ey0=; b=mz3FIZaC7yUiIbSkBnT5I0B2EiTundoXMF2DxEPg/zXm7jwKS2znGI2QIcSmc80JcI Fha3TyHPEEkzrDwh43+jq9ndEbStyPWC8+mV0/eik0pyQQfd9B/KH9SOy/QFnGJi5si8 AgMsyMs7TQFkaa53mbnSWLuU2r5ikCPKCJ5RNHaYzN72KN23dtCqTKmZkuhKe7WwAbs4 IRbbf646DxUMEj0wdwsY+E6wlNs2a7JqNtcUOPHEqca8H52e5pZ+ddnaN+phKu7Is+oQ buIb5VOhaZNp7m+soudjwdRS8ZBEXpNUg4K9EmhCj/0sAnj9UA5OCfJCj9B+NeO/DxSS nQqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697755074; x=1698359874; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fYRhWwDjISXm74qste3qKRlk+PEfcKkBEn/W5v18Ey0=; b=PSW/aS267jJITiWjdT2PEG46w8m2wxJyQismOulbEeKaQAo3qQO5Gv9seadGqQ8WeH TwoCX0ttl2S9mtOUBxrVKHz9myND0e2ZkQDmfSxK+cif570cuF+FyIYypcjECpPHI4CT QzCkGVE0/U2ure0WDuJZuMggSTyiq6/kfNvj5yJmsuLKcXcQ+8JmTR+hykWduff0Pgbx 8V9xSRtANWhKv6BsCW6VnnpdXx3emGRejZGINTjHYyhOeYZWFU1hKiyv7sObSCMA4U3w vkOSHWm1fOzc3K533z9QQ5tGe/VlaFqtAxUHbtERzUhX6YxWpdnuwndx7+mSXGKOpXb3 maEQ== X-Gm-Message-State: AOJu0YylZKCHSkZSFOTdqIDypEeb1Bl5T7YZFMnmWOc0t7pLLFRShiqC V+wxjH68tBG/3hYHcv3+Bx5ij7qHX/A= X-Google-Smtp-Source: AGHT+IHqynF9qdtN7Y88MMamqEy+/5gMGuLbXTjX6LYTv+Ikv6x6DcHqT7atBMdXQ/CcAz8t0tu5zA== X-Received: by 2002:a05:6808:dc4:b0:3b2:ee75:31f with SMTP id g4-20020a0568080dc400b003b2ee75031fmr130405oic.49.1697755074278; Thu, 19 Oct 2023 15:37:54 -0700 (PDT) Received: from [192.168.222.18] ([107.159.92.130]) by smtp.gmail.com with ESMTPSA id o27-20020a05620a22db00b007778503ebf4sm149676qki.16.2023.10.19.15.37.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 15:37:53 -0700 (PDT) Message-ID: Date: Thu, 19 Oct 2023 18:37:52 -0400 List-Id: Discussion of git use in the FreeBSD project List-Archive: https://lists.freebsd.org/archives/freebsd-git List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-git@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fwd: Right way to make a store local changes to repos Content-Language: en-US To: Anton Saietskii , freebsd-git@freebsd.org References: From: Marc Branchaud In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::22c:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-git@freebsd.org]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4SBN030g7Qz4W8V On 2023-10-18 11:08, Anton Saietskii wrote: > Hi folks, > > Here's what I'm doing: > * "git clone .../ports.git" > * since there are some patches which will never hit main tree (like > ccache support in bsd.gecko.mk), "git checkout -b local" > * "git pull -r" when I'm on local, hacking, commits, pull again, ... > * if I need to make some patch and send it -- I do "git checkout -b > " from local and "diff"/"format-patch local" when ready, then > "git checkout local" back > > To summarize: > origin/main -> main > local == I pull here, store local patches here So you are not keeping your local "main" branch up to date. That's perfectly reasonable. > feature-X == creating from local, I do patches which I send back here > > But sometimes, though not very often, I need to create a patch from a > clean tree (or switch to it for another reason), and here comes the > issue: "local" is up to date with "origin/main", but "main" is not. > Let's say it's 1000 commits behind (with only ~5 local ones), and > those commits changed 4000 files, so when I do "git checkout main" -- Don't checkout "main", since it's so out of date. Instead, create and checkout a new branch for your "clean" patch, based on "origin/main" (which is kept up to date by your pulls): git checkout -b my-clean-patch-branch origin/main M.