From nobody Fri Jun 4 03:06:20 2021 X-Original-To: freebsd-current@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 4DF9613725ED for ; Fri, 4 Jun 2021 03:06:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (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 4Fx72d12fHz3kpv for ; Fri, 4 Jun 2021 03:06:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-lf1-x131.google.com with SMTP id a2so11867622lfc.9 for ; Thu, 03 Jun 2021 20:06:32 -0700 (PDT) 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=rxpcFbZM2fO7Tgt9/Ha0FqN62PZVL1zbBr2GiE9D+Cw=; b=bWfRbC9iikIRD5NrEY4yIDOuEPju0c28KrLzrIT3BO+6O1It0tE1w3yHJQs95F3nMb mR3s8C/OitL61oFLz8wDpL3uzt1yfPMI0RT3Y+a24SsCJJtBRtYJQmBSLCDSUj1G9QLl v+25slJiszkVM/JCUxvdxHNwUcPlepgsaB1NY2Jy2zujjHoHHYJJ2PoX4FnYTlgj5oER l0pGSHRGHDRExvi0w7FTOvWFWdGjbq8BBOTDSDMLgTgAQlAfBfOaPw2FkbDLsRNLcWt3 u1GVVGZZvA5QB4OtdwtpPBh4QmhdJBLIJNyyE80RHPfr1K6bg84hTCgj/U32yJmxb4VP SyPQ== 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=rxpcFbZM2fO7Tgt9/Ha0FqN62PZVL1zbBr2GiE9D+Cw=; b=XCs2Ji7iTHyauMYPY0uGVThpiS3ZFjjYwy7yQj5hXyuWskd8eZjPPC6TBgyXEjyaxy Xev4QPEPYnl3AF1JYrXVWEg/dLUVwWpAUGBnViLueaP7NEybc5X2KhrTJFoiBFu3ai2J c1nHEDC3c/38ZHbX7PQQn/qZKJmCgWEuu4ENbzlmuflTiT7dBWTm5DJdBfxu11MBVG/4 KDygvhbMVHKUIrd6kp6CUKCQAayGZ6NQnrIxZCk+AqVEaYLL1z6kAozwwK2FY2h4QGpO ZXDT6dxQIXZ5QVuaziqclliJt4Vs/9472NPQUnqGn8l6n+sK/mf5rp2uT3c4CzSm7x92 X5fA== X-Gm-Message-State: AOAM531SMN2b21uVLocxxIPzhYiRGsRILkUaCf5YknjUmjyxSEpOWwqv op3OpOGVjpPx2lOea9a6cDEAv3EIFUO2qoygBes6QaU2Qd5TRA== X-Google-Smtp-Source: ABdhPJwrXyPJz5anZT/0pp1KtsRmoXQfj7pgJL1mHfp3R2gEhmB+ERbmrZ4AAH4P/BU+QRRDlEDPBrYPEwHdACP5W8I= X-Received: by 2002:a05:6512:2010:: with SMTP id a16mr1359870lfb.550.1622775991284; Thu, 03 Jun 2021 20:06:31 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Thu, 3 Jun 2021 21:06:20 -0600 Message-ID: Subject: Re: git MFC/cherry-pick question To: Alan Somers Cc: Rick Macklem , FreeBSD Current Content-Type: multipart/alternative; boundary="00000000000082ccb205c3e7fa78" X-Rspamd-Queue-Id: 4Fx72d12fHz3kpv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --00000000000082ccb205c3e7fa78 Content-Type: text/plain; charset="UTF-8" On Thu, Jun 3, 2021 at 8:29 PM Alan Somers wrote: > On Thu, Jun 3, 2021 at 8:13 PM Rick Macklem wrote: > > > Hi, > > > > I am trying to MFC a commit to stable/12. > > The cherry-pick works, but the resultant code > > is not correct and won't build. > > --> I broke the build yesterday and manually > > reverted the breakage. > > > > So, how do I do this? > > > > Do I have to manually edit the file after the > > cherry-pick and then do something like a > > git commit -a > > to get the edited change in, or is there a > > way to tell it to add it to the cherry-pick or ?? > > > > Thanks anyone, for help with this, rick > > > > Is the resulting code incorrect because of a git merge error, or because > stable/13 requires slightly different code than main? If it's the latter, > then after the "git cherry-pick", you should edit the file manually and do > a "git commit -a --amend". That will produce the right result. You don't > have to worry about screwing up merge history by using "--amend", because > "git cherry-pick" already screws up merge history. If your problem is the > former, then the same solution will work, although you might be able to > solve it by using some fancy git merge options instead. > git cherry-pick does not screw up merge history. The hashes of the diffs are used by git to know what's been merged and what hasn't. git commit --amend to fix things up screws up this mechanism a bit. That's why we do the 'git cherry-pick -x' which records the hash as a backup. git log --cherry-pick can help find changes to merge. There's been some scripts offered to also help find things... And usually when git cherry-pick doesn't produce working code, it's because other things weren't cherry-pucked that the code depends on. Sometimes you can find the changes to cherry-pick it, other times you have to do a manual fixup. Warner --00000000000082ccb205c3e7fa78--