[development] Quoting nids in comments

Angie Byron drupal-devel at webchick.net
Fri Mar 17 04:55:39 UTC 2006


Karthik wrote:
> What do people think about mentioning the issue nid in the comment for
> some of the more trickier/obscure fixes? I'm not sure if this already
> being done - I haven't come across any instances of this. But adding
> the nid will save a lot of time and effort for everybody IMO..
> 
> Just a thought.
> Cheers,
> -K

Just checking... are you aware of the annotate feature @
http://cvs.drupal.org/viewcvs/drupal/ ? I ask because I wasn't until very
recently, and it is the freaking bomb. It seems like it is perfect for
situations like you describe.

Let's take a look at form.inc, for example:

http://cvs.drupal.org/viewcvs/drupal/drupal/includes/form.inc?view=markup

Inside here we see the following line:

if ($form_values['form_token'] != md5(session_id() . $form['#token'] .
variable_get('drupal_private_key', ''))) {

Form tokens? Gee, I wonder what that was all about.

Click the "annotate" link near the top of the file:

http://cvs.drupal.org/viewcvs/drupal/drupal/includes/form.inc?annotate=1.79

Now you get, line by line, the file version numbers where that line first
appeared, along with who committed it.

So we see that line originally appeared in version 1.59 of the file. If you
click "1.59", it will show you a diff between that version and the one before
it. Click "Revision Log" and you're back to a full view of all file revisions.
Now you can Ctrl+F for "revision 1.59" and you'll see:

- Patch by chx: made form tokens work.

Haha, ok so I picked a bad example. :P~ But the revision before that has the
message:

- Patch #46227 by yogadex: fixed problem with form validation.

And sure enough, @ http://drupal.org/node/46227 you can see the discussion about
the original patch and the follow-up that's in HEAD now.

If you already knew about that feature and you don't find that good enough then
my apologies but it's been a life-saver to me, so figured I would share it with
others who might not have come across it.

-Angie



More information about the development mailing list