world file should support comments (#). The code that loads it simply could push each line through s/\#.*$//;
What for? It's not meant to be edited directly, don't mess with it!
No point and would create a mess as we don't just append to the worldfile.
I do understand it's difficult. But I would like to reopen this bug. Maybe it's possible to support in-line comments, something like: dev-libs/ossp-uuid # required, because ... It would definitely help. Because right now, I have a separate file in which I document packages I have added to the world file. Some entries are obvious (like /media-gfx/gimp). But entries like dev-libs/ossp-uuid aren't. For me, it's necessary to document why they are in the world file. At least comment #1 ("It's not meant to be edited directly") is not true anymore. "Man emerge" explicitly states: "You can safely edit this file, adding packages that you want to be considered in world set updates and removing those that you do not want to be considered."
(In reply to Michael Hofmann from comment #3) > At least comment #1 ("It's not meant to be edited directly") is not true > anymore. "Man emerge" explicitly states: "You can safely edit this file, > adding packages that you want to be considered in world set updates and > removing those that you do not want to be considered." The man page has said that since before 2005-08-28 (when the portage repo was migrated from CVS to Subversion). Comment 1 was posted after that date. I certainly don't think we want to encourage people to manually edit the world file.
How about a change to emerge to allow "--blame='I like this package'", which could be implemented as an inline comment formatted as " # I like this package" after the package name in the world file, along with support in unmerge and depclean to display the blame for any packages being removed? That would give an UI to insert and use comments in the world file without any manual editing.