From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:f42::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id SIL6A/M6aWJpCQAAsNZ9tg (envelope-from ) for ; Wed, 27 Apr 2022 12:45:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IDHYA/M6aWLR6wAAauVa8A (envelope-from ) for ; Wed, 27 Apr 2022 14:45:39 +0200 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E91CC1E383 for ; Wed, 27 Apr 2022 14:45:35 +0200 (CEST) Received: by mail-pj1-x1033.google.com with SMTP id r9so1381896pjo.5 for ; Wed, 27 Apr 2022 05:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Q0uMbJhkQQemxUCvfDa3RgoddsonDZAzvnMVFg4Y0I0=; b=RZG3WDlhGEZ+ZFhHXZIYAL5mgNcUsW7V8gU6iNOVOFGEU1qOGrguLitGAm72mh/uTZ NlbPgH7MKxuKW7eh7oAaoIA7rjnW+5An2rM3zPrFRuXhXx4+55V6jx44K5SKUdoekBj2 nbSFedJEs7A3e0Yrzx49grW7RsMRkLOFCwd7Mx0TJtAP1HK3CkEdYtPCySrGfzuw+gm/ 8p9rpz2AopRC3KxOfJ+AJDQp4DcfBV+8OtXnlZYsOJ5lmqEejPyS7Kt8lmLIFgfw4/f+ 1BBk9yebPWJxH4vs7mo0rM6fL2CdH3f0nFmBPdM08TaHJRGUGW/BNm/db7F5vDgKzIfJ Rueg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Q0uMbJhkQQemxUCvfDa3RgoddsonDZAzvnMVFg4Y0I0=; b=SgbvAkfH17fBo61xDbvRMgi9X69D47E+SC6I0ZnAsDHCABc+DIQLsk8eMoBdpPFu5M cW4NoECS+WxCnN3giSqZxTEjYzBtGj6ivXSZCtuq+NWihQEPZEWdFSUr2sDWTyfXvthC cM3kYegaVQHWiaQlO94S0WuZYcoWb6m4Z1W+vpZadrilgJupPCgoagDzt/HuaOD5SUI7 AXk3LZtZ6maS+Fwlit9+L7sT2lTIM0qRmLG1Msv0bsR0HOHwCRkXfcD5bdDp5azvlAwI Tttz4ww6hSF5q19lFNUtdcstqveNIAvNFtcgf5sb8IRVs7k2M1CemTrKWvWe+Kv1YZgU lLBw== X-Gm-Message-State: AOAM5325ivUIE1Vc1dNnX1Ig+m6mp3ZuLwKYgamphyV5EfdCKdySf2CY YAHtBUeuyypExJwFllAGoNC/PX4a+OITTekr X-Google-Smtp-Source: ABdhPJxhmOgea5U1nKCZ7F/SuQHOkV0kXtToYnw2KSd+pt/OnZuCtljIdsVa9btRvc2uGc7fs9H6RA== X-Received: by 2002:a17:902:8ec8:b0:156:847b:a8f8 with SMTP id x8-20020a1709028ec800b00156847ba8f8mr29293866plo.121.1651063533170; Wed, 27 Apr 2022 05:45:33 -0700 (PDT) Received: from localhost ([23.27.206.157]) by smtp.gmail.com with ESMTPSA id m2-20020a629402000000b0050d6a90bfd3sm4124657pfe.139.2022.04.27.05.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 05:45:32 -0700 (PDT) From: Ihor Radchenko To: Kyle Meyer Cc: piem@inbox.kyleam.com Subject: Re: Applying the same patch multiple times In-Reply-To: <8735hzi3t8.fsf@kyleam.com> References: <87v8uyncpl.fsf@localhost> <87pml6871p.fsf@kyleam.com> <8735i0urq7.fsf@localhost> <8735hzi3t8.fsf@kyleam.com> Date: Wed, 27 Apr 2022 20:46:24 +0800 Message-ID: <87mtg68zj3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: aspmx1.migadu.com; none X-Migadu-Scanner: scn1.migadu.com X-TUID: 0u7rEx59MPKv Kyle Meyer writes: > Ihor Radchenko writes: >> My starting point is the patch-containing email. Then, I run piem-am and >> use the default automatically generated branch. > > Interesting, using the email as the staring point for jumping to a > branch isn't a use case that I've considered, but, yeah, I can see why > that's appealing. Strictly speaking, I do not start from email. Rather I capture an Org heading from email and assign a TODO keyword. The heading is linked back to the email. Hence, when I start working on the patch, I jump from the heading to linked email and then to the working branch. >> Observed behaviour: Because the branch already exists and the patch is >> already applied, git am throws an error. > > Odd. I expected the git-checkout call upstream of git-am to fail > (saying something like "fatal: a branch named 'blah' already exists"). > Testing quickly, that's what I see on my end. > (Either way, that's of course not your desired behavior.) To clarify, by error I meant "branch already exists". So, it is the same on my end. >> I think a more useful approach would be something like: >> 1. piem creates a throwaway branch and apply the patch in the email >> 2. piem rebases the existing branch onto that throwaway branch > > I'm not quite connecting this (1)... > >> That way, I can start working on a patch from email, possibly add some >> followup commits and still be able to return to this WIP branch starting >> from the patch email. > > ...to this (2). 2 more or less aligns with how I understood the rest of > your email, but I don't see where 1 comes in. If you already applied a > patch from a particular message, that patch isn't changing, so wouldn't > you just want to jump to the associated branch, even if you amended the > given commit and/or added commits on top? Let me clarify what I had in mind. Consider that I start working on a patch at some point. I apply it to a new branch using piem-am. Then, I happen to make changes to the patch and run out of time to work. The changes are left on the git branch. Days or weeks later I return to my work on the patch. Again, the starting point is the patch email, not the git branch. I do not exactly recall whether I did any changes to the patch. I again run piem-am. I wish that piem-am reminds me about the old WIP state of the patch. One way to remind me about my local amendments is highlighting that there is a difference between the original patch in the email and the working branch. This difference can be shown e.g. by rebase conflict. This is where my (1) and (2) are coming from. Similar approach might be used to work with updated versions of the patch. Updates are rarely done with reroll count + interdiff. Highligting the difference between previous and current patches in the thread would be helpful. Though this second idea is probably more complicated compared to the above. Best, Ihor