From: "Michael S. Tsirkin" Subject: Re: Merge git-gui into 1.5.0 ? Date: Mon, 12 Feb 2007 08:25:29 +0200 Message-ID: <20070212062529.GE28231@mellanox.co.il> References: <7vvei89b9k.fsf@assigned-by-dhcp.cox.net> <20070212055903.GD28231@mellanox.co.il> Reply-To: "Michael S. Tsirkin" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Shawn O. Pearce" , Johannes Schindelin , git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Mon Feb 12 07:25:03 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1HGUcZ-000555-KL for gcvg-git@gmane.org; Mon, 12 Feb 2007 07:25:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933010AbXBLGY7 (ORCPT ); Mon, 12 Feb 2007 01:24:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933029AbXBLGY7 (ORCPT ); Mon, 12 Feb 2007 01:24:59 -0500 Received: from p02c11o144.mxlogic.net ([208.65.145.67]:33019 "EHLO p02c11o144.mxlogic.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933010AbXBLGY6 (ORCPT ); Mon, 12 Feb 2007 01:24:58 -0500 Received: from unknown [194.90.237.34] (EHLO mtlexch01.mtl.com) by p02c11o144.mxlogic.net (mxl_mta-4.0.2-2) with ESMTP id a3800d54.1830480816.47722.00-001.p02c11o144.mxlogic.net (envelope-from ); Sun, 11 Feb 2007 23:24:58 -0700 (MST) Received: from mellanox.co.il ([10.4.4.6]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 12 Feb 2007 08:27:12 +0200 Received: by mellanox.co.il (sSMTP sendmail emulation); Mon, 12 Feb 2007 08:22:58 +0200 Content-Disposition: inline In-Reply-To: <20070212055903.GD28231@mellanox.co.il> User-Agent: Mutt/1.5.11 X-OriginalArrivalTime: 12 Feb 2007 06:27:12.0205 (UTC) FILETIME=[D482A7D0:01C74E6E] X-TM-AS-Product-Ver: SMEX-7.0.0.1526-3.6.1039-14988.001 X-TM-AS-Result: No--15.154300-4.000000-2 X-Spam: [F=0.1295462456; S=0.129(2007010901)] X-MAIL-FROM: X-SOURCE-IP: [194.90.237.34] Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: > Quoting Michael S. Tsirkin : > Subject: Re: Merge git-gui into 1.5.0 ? > > > Quoting Junio C Hamano : > > Subject: Re: Merge git-gui into 1.5.0 ? > > > > "Michael S. Tsirkin" writes: > > > > > Actually, -p option to git-am is also useful for piping > > > patches to git-am directly from mail: sometimes people would generate > > > a patch by hand and this results in patches incorrect -p level. > > > > You also would need negative -p option to deal with it as well. > > Think of getting "diff a/git-add.txt b/git-add.txt" and wanting > > to apply it to Documentation/git-add.txt. > > Heh, right. With patch I just switch to another shell, cd to the correct > directory, start mutt *there* and pipe the message to patch. Since this already > seems to work for git-apply, maybe this can be made to work with git-am as well? > > Currently: > $git-am mbox > fatal: Not a git repository: '.git' > You need to run this command from the toplevel of the working tree. Junio, the following seems to work for me. Is this correct? If yes, adding -p is trivial. Make git-am support "negative strip-level" patches by running it in a subdirectory. Signed-off-by: Michael S. Tsirkin --- diff --git a/git-am.sh b/git-am.sh index 9a61234..4cea1d2 100755 --- a/git-am.sh +++ b/git-am.sh @@ -5,6 +5,8 @@ USAGE='[--signoff] [--dotest=] [--utf8 | --no-utf8] [--binary] [--3way] [--interactive] [--whitespace=