From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE572C19F21 for ; Thu, 4 Aug 2022 20:01:23 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.95) (envelope-from ) id 1oJgzO-0001LH-Cu; Thu, 04 Aug 2022 15:58:38 -0400 Received: from iodev.co.uk ([46.30.189.100]) by shelob.surriel.com with esmtp (Exim 4.95) (envelope-from ) id 1oJgzK-00014F-Hy for kernelnewbies@kernelnewbies.org; Thu, 04 Aug 2022 15:58:34 -0400 Received: from pirotess (79.red-83-50-138.dynamicip.rima-tde.net [83.50.138.79]) by iodev.co.uk (Postfix) with ESMTPSA id DEB8FDD884; Thu, 4 Aug 2022 21:58:17 +0200 (CEST) Date: Thu, 4 Aug 2022 21:58:16 +0200 From: Ismael Luceno To: jim.cromie@gmail.com Subject: Re: git magic or usage wisdom. Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On 04/Aug/2022 13:24, jim.cromie@gmail.com wrote: > so I have this patchset (sent to lkml recently ), > it adds a new struct: > struct _ddebug_info <...> > is there some git command magic to work this ? > > in a pre-git world, I might try > perl -pi -e 's/_ddebug_info/_ddebug_stateinfo/g' 00*.patch > > that "might" work, but could also create a myriad of conflicts > when the patchset is 'git am' d > and it might apply clean but still break on compile ? > > anyone care to opine on the probability of success ? > > If I try this, I'll report back. > ISTM more likely than my doing it manually. The approach is fine :). Whatever you do, you can't escape testing that the patches apply and compile... What you may simplify is the editing by chaining the commands to replay changes into a new branch: git format-patch -k --stdout base..old-branch | perl -pe '...' | git am -3 -k Further automation seems counterproductive. As for the editing, I would use the following perl code: if (/^\+/) { s/\b_ddebug_info\b/_ddebug_stateinfo/g } That way you limit edits only to new content, and the struct name is properly bounded by the regex. I guess that's about as robust as you can make it without going out of your way. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies