public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: linux-media@vger.kernel.org
Cc: Oliver Endriss <o.endriss@gmx.de>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Devin Heitmueller <dheitmueller@kernellabs.com>
Subject: Re: Debug code in HG repositories
Date: Sun, 03 Apr 2011 10:40:49 -0300	[thread overview]
Message-ID: <4D9878E1.7060603@redhat.com> (raw)
In-Reply-To: <201101110210.49205@orion.escape-edv.de>

Em 10-01-2011 23:10, Oliver Endriss escreveu:
> On Monday 10 January 2011 13:04:54 Mauro Carvalho Chehab wrote:
>> Em 07-01-2011 21:56, Oliver Endriss escreveu:
>>> ...
>>> There are large pieces of driver code which are currently unused, and
>>> nobody can tell whether they will ever be needed.
>>>
>>> On the other hand a developer spent days writing this stuff, and now it
>>> does not exist anymore - without any trace!
>>>
>>> The problem is not, that it is missing in the current snapshot, but
>>> that it has never been in the git repository, and there is no way to
>>> recover it.
>>
>> The Mercurial tree will stay there forever. We still have there the old CVS 
>> trees used by DVB and V4L development.
>>>
>>> Afaics, the only way to preserve this kind of code is 'out-of-tree'.
>>> It is a shame... :-(
>>
>> I see your point. It is harder for people to re-use that code, as they are not
>> upstream.
> 
> The main problem is that they do not even know that the code exists.
> 
> Maybe I should add some comment to the driver, that someone should look
> into the HG repository, before he starts re-inventing the wheel.
> 
>> It is easy to recover the changes with:
>>
>> $ gentree.pl 2.6.37 --strip_dead_code linux/ /tmp/stripped
>> $ gentree.pl 2.6.37  linux/ /tmp/not_stripped
>> $ diff -upr /tmp/stripped/ /tmp/not_stripped/ >/tmp/revert_removed_code.patch
>>
>> As a reference and further discussions, I'm enclosing the diff.
> 
> The resulting diff is far from complete.
> In fact, the most interesting parts are missing.
> 
> Apparently, the command
>     gentree.pl 2.6.37  linux/ /tmp/not_stripped
> stripped all '#if 0' blocks, which are not followed by a comment.
> Just compare the original ngene_av.c with the resulting version in
> /tmp/non_stripped.

Oliver,

I fixed the script. Sorry for taking a long time. Too much stuff here.
The fix patch were already merged at -hg.

It will now produce the right results. A regex expression were waiting for
 something after #if 1/#if 0, with is generally ok, as lines end with \n.
However, due to the usage of chomp, the \n character were removed, and the 
regex failed on lines with just '#if 0'.

-

On most places, the code inside #if 0 are just legacy stuff, where people
were trying to implement a different code for something. However, at ngene,
the code inside #if 0 are there just because the ngene developers didn't find
time yet to work on them. So, it may make sense to add those code into mainstream,
if people will uncomment part of those code. So, feel free to send me a patch
adding the commented code, if you need.

Thanks,
Mauro

  reply	other threads:[~2011-04-03 13:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 19:53 Debug code in HG repositories Oliver Endriss
2011-01-07 20:13 ` Devin Heitmueller
2011-01-07 21:06   ` Hans Verkuil
2011-01-07 23:42     ` Theodore Kilgore
2011-01-10 11:46       ` Mauro Carvalho Chehab
2011-01-10 13:05         ` Johannes Stezenbach
2011-01-10 22:00         ` Theodore Kilgore
2011-01-07 23:56     ` Oliver Endriss
2011-01-10 12:04       ` Mauro Carvalho Chehab
2011-01-10 12:27         ` Mauro Carvalho Chehab
2011-01-11  1:20           ` Oliver Endriss
2011-01-11  1:10         ` Oliver Endriss
2011-04-03 13:40           ` Mauro Carvalho Chehab [this message]
2011-01-08  1:02     ` Vincent McIntyre
2011-01-10 12:33       ` Mauro Carvalho Chehab
2011-01-11 10:37         ` Vincent McIntyre
2011-01-11 16:21           ` Mauro Carvalho Chehab
2011-01-11 10:47         ` Vincent McIntyre
2011-01-11 16:26           ` Mauro Carvalho Chehab
2011-01-08  4:08     ` VDR User
2011-01-10 11:27     ` Mauro Carvalho Chehab
2011-01-08  6:06   ` Jarod Wilson

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=4D9878E1.7060603@redhat.com \
    --to=mchehab@redhat.com \
    --cc=dheitmueller@kernellabs.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=o.endriss@gmx.de \
    /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