From: Ismael Luceno <ismael@iodev.co.uk>
To: jim.cromie@gmail.com
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: git magic or usage wisdom.
Date: Thu, 4 Aug 2022 21:58:16 +0200 [thread overview]
Message-ID: <Yuwk2LA0cvBLXAGa@pirotess> (raw)
In-Reply-To: <CAJfuBxxYvOz8m=Ln-9RcruDHgsdwzc20kTfXSFAY4y86R0wO0Q@mail.gmail.com>
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
next prev parent reply other threads:[~2022-08-04 20:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 19:24 git magic or usage wisdom jim.cromie
2022-08-04 19:58 ` Ismael Luceno [this message]
2022-08-05 17:09 ` jim.cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yuwk2LA0cvBLXAGa@pirotess \
--to=ismael@iodev.co.uk \
--cc=jim.cromie@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.