git-format-patch -3
This teaches "git-format-patch" to honor the --max-count parameter revision traversal machinery takes, so that you can say "git-format-patch -3" to process the three topmost commits from the current HEAD (or "git-format-patch -2 topic" to name a specific branch). Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 17, 2007 at 13:35 UTC
7c496280104e02cb2a02dbbe0caf3510e0e87e42
2 files changed
+10
-2
Documentation/git-format-patch.txt
+3
@@ -126,6 +126,9 @@ git-format-patch -M -B origin::
126
understand renaming patches, so use it only when you know
127
the recipient uses git to apply your patch.
128
129
+git-format-patch -3::
130
+ Extract three topmost commits from the current branch
131
+ and format them as e-mailable patches.
132
133
See Also
134
--------
builtin-log.c
+7
-2
@@ -482,8 +482,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
482
}
483
484
if (rev.pending.nr == 1) {
485
- rev.pending.objects[0].item->flags |= UNINTERESTING;
486
- add_head(&rev);
485
+ if (rev.max_count < 0) {
486
+ rev.pending.objects[0].item->flags |= UNINTERESTING;
487
+ add_head(&rev);
488
+ }
489
+ /* Otherwise, it is "format-patch -22 HEAD", and
490
+ * get_revision() would return only the specified count.
491
+ */
492
}
493
494
if (ignore_if_in_upstream)