From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2429 invoked by alias); 17 Mar 2013 15:00:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31160 Received: (qmail 1322 invoked from network); 17 Mar 2013 15:00:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,FAKE_REPLY_C autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at ruderich.org designates 178.63.68.90 as permitted sender) Date: Sun, 17 Mar 2013 15:55:07 +0100 From: Simon Ruderich To: zsh-workers@zsh.org Subject: Re: Access to CVS Message-ID: <20130317145507.GA21498@ruderich.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=_zucker.schokokeks.org-15586-1363532107-0001-2" Content-Disposition: inline In-Reply-To: <20121213145747.GB9597@ruderich.org> <87sj7ixgxo.fsf@ft.bewatermyfriend.org> User-Agent: Mutt/1.5.21 (2013-02-25) --=_zucker.schokokeks.org-15586-1363532107-0001-2 Content-Type: multipart/mixed; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 07, 2012 at 12:03:31PM +0100, Frank Terbeck wrote: > It would be great if we could make "git-am" process the X-Seq: header, > too. If that would be possible, integrating someone else's patch from > the mailing list would boil down to this: > > - Save the mail to a file. > - git am foo.patch > - git push On Thu, Dec 13, 2012 at 03:57:47PM +0100, Simon Ruderich wrote: > Sadly git-am doesn't provide any hooks which get the original > patch message as argument. > > [snip] Turns out this isn't quite true. Attached is a simple applypatch-msg hook which extracts the X-Seq =66rom the original patch and prepends it to the commit message (if the message doesn't already contain a sequence number). The hook should work fine all Git versions and works fine with multiple patches (mbox of patches or multiple patch files passed to git am). To use it simply drop it in .git/hooks/ and chmod +x it. Please tell me what you think. If it works fine we should ship it in Etc/ and developers can just symlink it into .git/hooks/. Btw. what's missing to complete the Git conversion? Please tell me if there's anything I can do to help. I'd really like to see Zsh finally switch to Git. Regards Simon --=20 + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x92FEFDB7E44C32F9 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=applypatch-msg #!/bin/sh # applypatch-msg for Zsh which extracts X-Seq from the patch and prepends it # to the commit message. if test ! -f "$1"; then exit 0 fi # Path to ".git/rebase-apply/" directory. dotest=`dirname "$1"` # Path to the patch file which will be applied. this=`cat "$dotest/next"` patch="$dotest/`printf '%04d' "$this"`" # Extract sequence number. sequence=`grep -E '^X-Seq: ' "$patch" | awk '{ print $2 }'` if test -z "$sequence"; then exit 0 fi # Prepend sequence number to commit message if not already present. if ! grep -E '^unposted: ' "$1" > /dev/null && ! grep -E '^[0-9][0-9]*: ' "$1" > /dev/null; then printf "%s: " "$sequence" > "$1.tmp" cat "$1" >> "$1.tmp" mv "$1.tmp" "$1" fi --0F1p//8PRICkK4MW-- --=_zucker.schokokeks.org-15586-1363532107-0001-2 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJRRdlLAAoJEJL+/bfkTDL5CW0P/R7FL/dPSBvmyxGbAILJUBJ4 cyzmwyhVhPnwunG5cEjFw7/oAzrMzWryYMMBKfwKfmzf8CE4G9mrHgE4JqLPMEMM K5lMrmx0Z+5EjO9d+C9Pqkg7ynib0IPm74JLpHl4pa157Dz4JZIhmrVcPUZcd/8H cwReMyp0xxxybW7IDFlocRSQast1WoLzcn+kIKXsuAM79eg/GT+MP2AC4MvbrZla vGz1SSy2u87luGlQsxfv5wEKRZPRU2LZaqI74SBLE4v8myEOe1g1EKtGYaSoMiVh DYpYVK2XeUhvj3a3xKsDzHEs8KlqtXDZbzTCpot8e2H2P61AhzTqc8AWesntSsqq HKbbeLwt5JXLWcZsKf5jgDrQCvqld/cxkhVHfde+dVjcdYv8yvsRAhpmnq6GwPTO i+d7eesMdnumAGXtP3DG90h3Y7+otFRVE8ycRgiBce6JLH7WWNrtXIS4xCs9PsH2 exIuGa4Grhkk4aGNIabRFKaNv073AXElV344Cwb4p/i6nJ1yFZtOAlZnEpi+HEIM vviCAPw0un2Jge1h5jaaAXJyFFe8yXlrcTcRqsar4jBuv1MfIMVBgowBv15AD756 uRRPkeXDLsZ2ah/GPHo4Ex29trrheB1Pdz6zXNGYSNalpX3PYRk6+oDYbNm29R8P 8dT2s2alGvr5mIa0cU+M =72e8 -----END PGP SIGNATURE----- --=_zucker.schokokeks.org-15586-1363532107-0001-2--