Skip to contentSkip to conversation

Add script for patch submission via e-mail.

PATCH In review Junio C Hamano 3 participants 6 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add script for patch submission via e-mail.

This git-format-patch-script is what I use to prepare patches for e-mail submission.

Typical usage is:

$ git-format-patch-script -B -C --find-copies-harder HEAD linus

to prepare each commit with its patch since "HEAD" forked from "linus", one file per patch for e-mail submission. Each output file is numbered sequentially from 1, and uses the first line of the commit message (massaged for pathname safety) as the filename.

$ git-format-patch-script -B -C --find-copies-harder HEAD linus .patch/

creates output files in .patch/ directory.

---
*** Linus I am submitting this one because some patches on *** read-tree I am going to send you will need this for *** formatting into a form that is easier to review. And this *** in turn can use diff-tree --find-copies-harder, which I *** indeed used to generate the patches that follow.

 Makefile                |    3 +-
 git-format-patch-script |   93 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+), 1 deletions(-)
Makefile +2 -1
@@ -23,7 +23,8 @@ INSTALL=install
 SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
 	git-pull-script git-tag-script git-resolve-script git-whatchanged \
 	git-deltafy-script git-fetch-script git-status-script git-commit-script \
-	git-log-script git-shortlog git-cvsimport-script
+	git-log-script git-shortlog git-cvsimport-script \
+	git-format-patch-script
 
 PROG=   git-update-cache git-diff-files git-init-db git-write-tree \
 	git-read-tree git-commit-tree git-cat-file git-fsck-cache \
git-format-patch-script new file +93 -0

93 lines not on this page · raw message

------------

#1 lore raw

Dear diary, on Sat, Jun 11, 2005 at 03:32:30AM CEST, I got a letter where Junio C Hamano <[email protected]> told me that...

Quoted 17 lines

This git-format-patch-script is what I use to prepare patches for e-mail submission.

Typical usage is:

$ git-format-patch-script -B -C --find-copies-harder HEAD linus

to prepare each commit with its patch since "HEAD" forked from "linus", one file per patch for e-mail submission. Each output file is numbered sequentially from 1, and uses the first line of the commit message (massaged for pathname safety) as the filename.

$ git-format-patch-script -B -C --find-copies-harder HEAD linus .patch/

creates output files in .patch/ directory.

Quoted 7 lines

---
*** Linus I am submitting this one because some patches on *** read-tree I am going to send you will need this for *** formatting into a form that is easier to review. And this *** in turn can use diff-tree --find-copies-harder, which I *** indeed used to generate the patches that follow.

Any reason why this was not applied? It appears kind of cool. Well, I will probably take it and extend cg-mkpatch with it so I don't need it in Git, but I'm so altruistic and want to bring at least a bit of light to the gloomy dark world of the poor core Git plumbing users. ;-)

Signature · 3 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..
#2 lore raw
Quoted 5 lines · Petr Baudis

Any reason why this was not applied? It appears kind of cool. Well, I will probably take it and extend cg-mkpatch with it so I don't need it in Git, but I'm so altruistic and want to bring at least a bit of light to the gloomy dark world of the poor core Git plumbing users. ;-)

As one who inhabits that dark world, I second that!

jon.

#3 lore raw

PATCH 1/1 Add script for patch submission via e-mail.

In reply to Petr Baudis

[PATCH] git-format-patch: Prepare patches for e-mail submission.

This is the script I use to prepare patches for e-mail submission.

---

*** The latest incarnation. Uses --merge-order while generating *** the list of patches to number them better.

 Makefile                |    3 +
 git-format-patch-script |  121 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+), 1 deletions(-)
 create mode 100755 git-format-patch-script

1a3c4d6335860c7bfd09b997b19c850620c6fb50

Makefile +2 -1
@@ -31,7 +31,8 @@ SCRIPTS=git git-apply-patch-script git-m
 	git-fetch-script git-status-script git-commit-script \
 	git-log-script git-shortlog git-cvsimport-script git-diff-script \
 	git-reset-script git-add-script git-checkout-script git-clone-script \
-	gitk git-cherry git-rebase-script git-relink-script git-repack-script
+	gitk git-cherry git-rebase-script git-relink-script git-repack-script \
+	git-format-patch-script
 
 PROG=   git-update-cache git-diff-files git-init-db git-write-tree \
 	git-read-tree git-commit-tree git-cat-file git-fsck-cache \
git-format-patch-script new file +121 -0

121 lines not on this page · raw message

#4 lore raw
In reply to Petr Baudis
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"PB" == Petr Baudis <[email protected]> writes:

PB> Any reason why this was not applied? It appears kind of cool.

FYI, the one in <[email protected]> is newer than what you quoted.

One thing _I_ am unhappy about what it does is that it does not try to be intelligent about merges (I haven't tried the script on a merged head myself).

When you think about "project lead" vs "individual developer" modes of operation, the latter is primarily "keep rebasing commits in my fork and re-throwing them upstream until some of them stick", so not supporting merges specially would not be so big a flaw. However, at least it should use --merge-order to get the epochs decomposed right, in order to produce anything remotely useful when dealing with a merged head.

#5 lore raw
Quoted 10 lines · Junio C Hamano
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"PB" == Petr Baudis <[email protected]> writes:

PB> Any reason why this was not applied? It appears kind of cool.

FYI, the one in <[email protected]> is newer than what you quoted.

One thing _I_ am unhappy about what it does is that it does not try to be intelligent about merges (I haven't tried the script on a merged head myself).

I am not completely sure this is really a problem. I would presume that the project lead doesn't really need to use git-format-patch-script and the individual developer should probably rebase on the latest head which is either done by trivially reapplying the patches in sequence automatically or reapplying the patches in sequence with some edits to fix any conflicts that have arisen.

So, it is not clear to me git-format-patch-script needs to worry about merge questions. It'd be better to put such logic in a separate rebasing script, I think. If anything, you might want to add checks to git-format-patch script that refuse to generate a patch sequence for any sequence of patches that spans a merge commit.

jon.

Signature · 2 lines
homepage: http://www.zeta.org.au/~jon/
blog: http://orwelliantremors.blogspot.com/