Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Submitting patches [was: Re: Updated _git completion (not attached)]



On Sun, 20 Mar 2011, Frank Terbeck wrote:

Johan Sundström wrote:
On Fri, Mar 18, 2011 at 14:18, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
[Etc/zsh-development-guide]

That being said, the output of "git format-patch" is usable, too. Exchanging git's default "[PATCH]" by "PATCH: " would be extra sugar.

Running perl -pi -e 's/^(Subject: ).(PATCH[^]]*)./$1$2:/' *.patch on format-patch files fixes that (it seems command line options to git can't). Maybe a useful note for the dev guide?

The archive reacts to anything that starts with "PATCH". You can see the
results on <http://www.zsh.org/mla/patches.shtml>. So, your Perl snippet
would work. Even for numbered patches.

Based on that list, it appears that no Perl script is necessary. Nikolai's patches labeled with the standard `git` way were picked up well enough:

Subject: [PATCH 3/4] Fix git-branch -[dD] -r completion
Subject: [PATCH 1/4] Fix typo
Subject: [PATCH 4/4] Fix typo in git-send-email completion
Subject: [PATCH 2/4] Only show modified files for git-checkout without tree

were grabbed as:

3/4] Fix git-branch -[dD] -r completion
1/4] Fix typo
4/4] Fix typo in git-send-email completion
2/4] Only show modified files for git-checkout without tree

Personally, I think it's better that the "series" info stays there. The only ugliness is the '] ' instead of ': '.

And, with `git send-email --annotate` (which IMO is easier than `git format-patch` and then firing up an email client), there's no clear point at which to run the Perl script. (Though, with --annotate, you can simply modify the Subject: line in your editor.)

I have the following in my .gitconfig:

[alias]
	# ... 45 lines later ...
	email-zsh = "!email () { email=\"$(git config --get user.email)\" ; user=\"$(git config --get user.name)\" ; git send-email --annotate --envelope-sender='<'$email'>' --from=\"$user <$email>\" --cc=\"$user <$email>\" --to='Zsh Workers <zsh-workers@xxxxxxx>' \"$@\" ; } ; email"

--annotate - allows editing the messages
--envelope-sender - helps with some mailing lists
--cc - so I get a copy of the message
--from - (not usually necessary, I don't think -- remnant from doing other email cartwheels in other aliases)

The "!fn-name () { function-body ; } ; fn-name" idiom might not be necessary for this case, but it comes in handy when you want to munge the arguments list inside function-body.

The other options should be obvious, and any other options you pass on the commandline (--dry-run, list of revisions, etc.) get passed up to send-email, which passes any options it doesn't use up to format-patch.

--
Best,
Ben


Messages sorted by: Reverse Date, Date, Thread, Author