From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: Re: [RFC PATCH] sit-send-email.pl: Add --to-cmd Date: Thu, 23 Sep 2010 17:50:05 +0000 Message-ID: References: <1285227413.7286.47.camel@Joe-Laptop> <20100923090931.GA29789@albatros> <20100923120024.GA26715@albatros> <1285253867.31572.13.camel@Joe-Laptop> <1285262237.31572.18.camel@Joe-Laptop> <1285263993.31572.25.camel@Joe-Laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Julia Lawall , git , Vasiliy Kulikov , matt mooney , kernel-janitors@vger.kernel.org, Dan Carpenter To: Joe Perches X-From: git-owner@vger.kernel.org Thu Sep 23 19:50:17 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oypw0-0004A9-KO for gcvg-git-2@lo.gmane.org; Thu, 23 Sep 2010 19:50:17 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755887Ab0IWRuI convert rfc822-to-quoted-printable (ORCPT ); Thu, 23 Sep 2010 13:50:08 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:53620 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421Ab0IWRuG convert rfc822-to-8bit (ORCPT ); Thu, 23 Sep 2010 13:50:06 -0400 Received: by iwn5 with SMTP id 5so1620171iwn.19 for ; Thu, 23 Sep 2010 10:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=XQtgyscrBTs2HfsXPpP44z6MqTZyFtOxWqDMKQt81GI=; b=oe1nfPIFke8DbeclFEG0AJoD8kPLu7PTJTzivfkCrIhTMBSIkOmGUnw/MySMmvUqmk 1qO4ETmv/eABv03xrNy16i77WieY7S0DpYiqkfaFNL2/Zdb27Aa/8Mbr9jch4rjDivVQ y2nzIv1xJnCCUYrWMrvNQcw7MLud0Y/daxz28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=F7+8S1AUkiIX9PUOnr6q0YeKy1cqYT9ihUGqlvP5tphHL8gUYbGvspAOWZ+FyPVS1z xUK1bW21wT//n5A3Zu+mER75MK7akDpKk/JJZmhYW/O42Fy/P7ICxCpwTymqeVc3Zovo Igt4VgQPsA7iYeQYS8PBlx9mA4/8S63J/kkEo= Received: by 10.231.162.2 with SMTP id t2mr2348852ibx.57.1285264205066; Thu, 23 Sep 2010 10:50:05 -0700 (PDT) Received: by 10.231.48.195 with HTTP; Thu, 23 Sep 2010 10:50:05 -0700 (PDT) In-Reply-To: <1285263993.31572.25.camel@Joe-Laptop> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, Sep 23, 2010 at 17:46, Joe Perches wrote: > On Thu, 2010-09-23 at 17:29 +0000, =C3=86var Arnfj=C3=B6r=C3=B0 Bjarm= ason wrote: >> On Thu, Sep 23, 2010 at 17:17, Joe Perches wrote: >> > I know there's a test harness in git, but >> > I don't know how to wire up the new options. >> You'd add the tests to t9001-send-email.sh and --tocmd out to some >> program you create. Is there anything in particular you need help >> with? > > Just the doing. =C2=A0I was (am) being lazy. > >> > -if (!@to) { >> > +if (!@to && $to_cmd eq "") { >> >> Why compare $to_cmd to "" instead of checking definedness? > > No real reason. =C2=A0Using define is the style used in the rest of > the file and it should be changed. > >> > @@ -1238,6 +1242,23 @@ foreach my $t (@files) { >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0close F; >> > >> > + =C2=A0 =C2=A0 =C2=A0 if (defined $to_cmd) { >> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 open(F, "$to_cm= d \Q$t\E |") >> >> quotemeta() is for escaping regexes, not shell syntax. You probably >> want IPC::Open2 or PC::Open3's functions which'll escape arguments f= or >> you. > > I just copied the style from the equivalent cc_cmd section below, > so if it's necessary, it should be changed there too. > >> I.e. do you need to strip whitespace from the beginning of the strin= g? > > I think so. This all sounds reasonable, but I really need to go through git-send-email.perl and fix all these bugs at some point...