public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
	GCC Mailing List <gcc@gcc.gnu.org>,
	Martin Jambor <mjambor@suse.cz>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	gfortran <fortran@gcc.gnu.org>
Subject: Re: [PATCH] git-backport: support renamed .cc files in commit message.
Date: Fri, 14 Jan 2022 16:26:04 +0100	[thread overview]
Message-ID: <96b660fc-0397-4ed5-a8ed-9e8b3aee3fd6@suse.cz> (raw)
In-Reply-To: <20220114084418.3779aea1@nbbrfq>

On 1/14/22 08:44, Bernhard Reutner-Fischer wrote:
> On Wed, 12 Jan 2022 16:54:46 +0100
> Martin Liška <mliska@suse.cz> wrote:
> 
>> +def replace_file_in_changelog(lines, filename):
>> +    if not filename.endswith('.cc'):
>> +        return
>> +
>> +    # consider all componenets of a path: gcc/ipa-icf.cc
>> +    while filename:
>> +        for i, line in enumerate(lines):
>> +            if filename in line:
>> +                line = line.replace(filename, filename[:-1])
>> +                lines[i] = line
>> +                return
>> +        parts = filename.split('/')
>> +        if len(parts) == 1:
>> +            return
>> +        filename = '/'.join(parts[1:])
>> +
> 
> I think you mean os.sep instead of the hardcoded slash.
> But i'd use os.path.split and os.path.join

Hello.

Well, these are all paths from a git commit message. And we require unix-style
of paths for all ChangeLog entries. So it should be correct.

Martin

> 
> thanks,


  reply	other threads:[~2022-01-14 15:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ri6mtk7vo41.fsf@suse.cz>
     [not found] ` <57564370-7184-ef62-039e-60b150058fd8@suse.cz>
     [not found]   ` <68946bf6-4b2f-b8f3-20b3-5cf3f2fd611c@moene.org>
2022-01-11 15:50     ` [PATCH] Mass rename of C++ .c files to .cc suffix Martin Liška
2022-01-11 15:56       ` Jakub Jelinek
2022-01-11 16:03         ` Martin Liška
2022-01-11 16:16           ` Jakub Jelinek
2022-01-12  8:58             ` Martin Liška
2022-01-12 15:54               ` [PATCH] git-backport: support renamed .cc files in commit message Martin Liška
2022-01-14  7:44                 ` Bernhard Reutner-Fischer
2022-01-14 15:26                   ` Martin Liška [this message]
2022-01-17 21:26                 ` Martin Liška
2022-01-18 19:10                   ` Harald Anlauf
2022-01-18 19:10                     ` Harald Anlauf
2022-01-19  8:07                     ` Martin Liška
2022-01-11 18:00       ` [PATCH] Mass rename of C++ .c files to .cc suffix Harald Anlauf
2022-01-11 18:00         ` Harald Anlauf
2022-01-11 18:23         ` Jonathan Wakely
2022-01-11 18:36           ` Jakub Jelinek

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=96b660fc-0397-4ed5-a8ed-9e8b3aee3fd6@suse.cz \
    --to=mliska@suse.cz \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=mjambor@suse.cz \
    --cc=rep.dot.nop@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).