public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@linaro.org>
To: Christian Biesinger <cbiesinger@google.com>
Cc: gdb@sourceware.org, Pedro Alves <palves@redhat.com>
Subject: Re: Renaming .c files to .cc?
Date: Wed, 11 Dec 2019 01:33:00 -0000	[thread overview]
Message-ID: <ebe7d0cc-9b2b-c1cd-1667-9e4b5363f176@linaro.org> (raw)
In-Reply-To: <CAPTJ0XG6FtH-7Jy8rN4K+pQmwkJ5AZ1q-StVmqoSxMGgH-KjsA@mail.gmail.com>

On 12/10/19 10:26 PM, Christian Biesinger wrote:
> On Tue, Dec 10, 2019 at 7:41 PM Luis Machado <luis.machado@linaro.org> wrote:
>>
>> On 12/10/19 7:18 PM, Christian Biesinger via gdb wrote:
>>> Hello all,
>>>
>>> I was wondering what people's thoughts are on renaming the .c files to
>>> .cc, since they are in fact C++ code? (Only for files under gdb/)
>>
>> I don't have strong objections to this other than it may make things
>> slightly more tedious to 'git blame' some files, as Tromey pointed out.
> 
> Can you elaborate on that? git blame seems to work as expected for this, e.g.:

I had not given this a try and was assuming it would just reset all the 
lines to the commit that renamed the file. Looks like it is smart enough 
to keep the change ids in there (checked now).

So this is a non-issue for me.

> $ git blame gdbsupport/gdb_string_view.h
> 7adcdf08e792 gdb/common/gdb_string_view.h     (Simon Marchi
> 2018-04-09 13:31:04 -0400   1) // Components for manipulating
> non-owning sequences of characters -*- C++ -*-
> 7adcdf08e792 gdb/common/gdb_string_view.h     (Simon Marchi
> 2018-04-09 13:31:04 -0400   2)
> 1a5c25988eab gdb/common/gdb_string_view.h     (Tom Tromey
> 2019-01-27 12:51:36 -0700   3)
> 1a5c25988eab gdb/common/gdb_string_view.h     (Tom Tromey
> 2019-01-27 12:51:36 -0700   4) #ifndef COMMON_GDB_STRING_VIEW_H
> 1a5c25988eab gdb/common/gdb_string_view.h     (Tom Tromey
> 2019-01-27 12:51:36 -0700   5) #define COMMON_GDB_STRING_VIEW_H
> ...
> 700545387df8 gdb/gdbsupport/gdb_string_view.h (Christian Biesinger
> 2019-10-01 13:36:07 -0500  49) #include "gdb_assert.h"
> 
> And git log has the --follow option for this purpose.
> 

That's good to know.

>> But i think that is excusable compared to better organization of source
>> files, for what they really are (C++ files).
>>
>>>
>>> Advantages:
>>> - Easier for newcomers to see that the code is, in fact, C++
>>> - Editors will syntax highlight C++ keywords w/o having to be told
>>> that these files are C++
>>
>> The above items sound like reasonable pluses.
>>
>>>
>>> On IRC it was mentioned that git may have issues with renames like
>>> that but I have found that "git log --follow" and such are doing a
>>> good job with that, at least as long as the same commit doesn't change
>>> the file too much while it is renamed, which I wouldn't expect to be a
>>> problem here.
>>>
>>> Thoughts?
>>> Christian
>>>

  reply	other threads:[~2019-12-11  1:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 22:19 Christian Biesinger via gdb
2019-12-11  0:42 ` Luis Machado
2019-12-11  1:27   ` Christian Biesinger via gdb
2019-12-11  1:33     ` Luis Machado [this message]
2019-12-11  2:24 ` Simon Marchi
2019-12-11  3:32 ` Eli Zaretskii
2019-12-11 23:00   ` Christian Biesinger via gdb
2019-12-12  6:17     ` Eli Zaretskii
2019-12-14 18:20       ` Christian Biesinger via gdb
2019-12-11 10:59 ` Pedro Alves
2019-12-11 16:35   ` Eli Zaretskii

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=ebe7d0cc-9b2b-c1cd-1667-9e4b5363f176@linaro.org \
    --to=luis.machado@linaro.org \
    --cc=cbiesinger@google.com \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.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).