Dan Zwell <dzwell@zwell.net> writes:Makes me wonder if you are better off with two new helper functions defined in Git.pm, as in: $prompt_color = $repo->config_color("interactive.prompt") || "bold blue") $normal_color = Git::color_to_ansi_code("normal"); I do not like a hash variable name that says it is a "mapping". It being a hash is enough indication that it is a mapping. You are better off naming such a mapping as if it is a function that takes one parameter (in this case, git name) and returns a single value (perl name). So I'd probably say: my %perl_attrib = ( ... ); (or "git_attrib_to_perl"). A use site of such a hash would look like this: push @perl_words, $perl_attrib{'ul'}; push @perl_names, $git_attrib_to_perl{'blink'}; Maybe it is just me, but aren't these easier to read? $word eq 'normal' ? exists $color_name{$word} with my %color_name = map { $_ => 1 } qw(black red ... white); at the beginning? exists $git_attrib_to_perl{$word} ? - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Roland Dreier | Re: Integration of SCST in the mainstream Linux kernel |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Linus Torvalds | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Frans Pop | svc: failed to register lockdv1 RPC service (errno 97). |
