From: Junio C Hamano Date: Thu, 12 Jul 2007 18:45:39 GMT Subject: Re: [PATCH] gitweb: new cgi parameter: option Message-ID: <7vy7hltq98.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <200707121211.32813.jnareb@gmail.com> Jakub Narebski writes: > [*1*] At least in gitweb. If I understand correctly, you can use > "git diff --cc tree1 tree2 tree2 ..." to get combined diff of specified > tree-ish; I'm not sure if git-diff-tree support this. And I know that > gitweb does not support this... at least for now. Would this be useful, > I wonder? I would say that would only be useful to satisfy curiosity. Luckily or unluckily I have not had real life use of that multiple tree comparison feature that is supported by "git diff" (multiple blob comparison is also available, which is mildly useful). >> +our $option = $cgi->param('option'); >> +if (defined $option) { >> + if (not grep(/^$option$/, keys %options)) { >> + die_error(undef, "Invalid option parameter"); >> + } "!exists $options{$option}" ? > I'd rather make it possible to pass multiple additional options, for > example both '--remove-empty' (to speed up) and '--no-merges' for the > history view. So I'd use > > +our @options = $cgi->param('option'); > > instead. Good point. > I'm also not sure if invalid option parameter for action should return > error, or be simply ignored. I'm mildly against "simply ignoring". > By the way, gitweb uses shortened names for paramaters. Perhaps 'opt' > or 'op' instead of 'options' here and in href subroutine (below)? Or even 'o' ;-).