Summary: | [PATCH] Typo patch for portage | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Andre Hinrichs <andre.hinrichs> |
Component: | Unclassified | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED OBSOLETE | ||
Severity: | trivial | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
typo patch
new patch file |
Description
Andre Hinrichs
2006-12-12 09:46:52 UTC
Created attachment 103875 [details, diff]
typo patch
Not good: this patch includes at least one API change (stopped reading it after the first) and removes some stuff it shouldn't remove (like \n). I assume you just ran sed on the file, but you have to verify it manually (unless someone else wants to fix this patch). Created attachment 103883 [details, diff]
new patch file
sorry, thought, that was only a newline...
Is it not?
Found this by typing "portageq --help"
Anyway, removed that from the patch file.
Still... there is a change of a variable name. But I think typos in active code is more bad than typos in comments, don't you think so?
(In reply to comment #3) > Created an attachment (id=103883) [edit] > new patch file > > sorry, thought, that was only a newline... > Is it not? > Found this by typing "portageq --help" > Anyway, removed that from the patch file. > Still... there is a change of a variable name. But I think typos in active code > is more bad than typos in comments, don't you think so? > Actually, typos in active code are forgiveable (typos or not the code is in a known working state) I would suggest to add substitute functions in case of mistyped function names. Here is an example: do_seperate(a,b,c) { obsolete_warning "please use do_separate instead" do_separate(a,b,c) } In case of compilable code (C,C++,JAVA) this could be a compiler warning. But if the typo is a local variable name which is only used in the function (as in this patch) then this should not harm anything. What do you think? And... is the patch ok or not? (In reply to comment #3) > sorry, thought, that was only a newline... > Is it not? The \n is the separator that the description refers to. > Still... there is a change of a variable name. But I think typos in active > code is more bad than typos in comments, don't you think so? s/more bad/worse/ ;) And no. If you fix a typo in code you have to fix all occurences, but if the typo is in a public symbol (like a function name or parameter) you can't do that as you don't have control over every possible caller (granted in this case there probably aren't any callers, didn't notice that the function was in repoman at first). But IMHO this kind of typo is mostly irrelevant anyway (I think everybody understands what is meant as it's phonetically correct). (In reply to comment #5) > I would suggest to add substitute functions in case of mistyped function > names. > Here is an example: > > do_seperate(a,b,c) > { > obsolete_warning "please use do_separate instead" > do_separate(a,b,c) > } Thanks, I know how to write a wrapper function ;) But wouldn't help in this case as the typo is in a parameter name. > But if the typo is a local variable name which is only used in the function > (as in this patch) then this should not harm anything. Just that it's not a local variable but a parameter. Ok, nobody actually calls functions defined in repoman (didn't notice the location at first) so you could probably get away with it in this case, but in portage.py for example breakage would be guaranteed. All of these typos are long fixed. |