From: Michael S. Tsirkin Date: Mon, 12 Feb 2007 06:25:29 GMT Subject: Re: Merge git-gui into 1.5.0 ? Message-ID: <20070212062529.GE28231@mellanox.co.il> In-Reply-To: <20070212055903.GD28231@mellanox.co.il> > 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=