Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-18 00:35:13 +0300
committerJunio C Hamano <junkio@cox.net>2007-01-18 10:48:20 +0300
commit7c496280104e02cb2a02dbbe0caf3510e0e87e42 (patch)
treec933ac8386c39163593f100bc09c00efac550efa /builtin-log.c
parentdf1b059d8dd5c16edaa98d7da842b2a32c01e526 (diff)
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>
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 1cd9d3f768..9453e6d2db 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -482,8 +482,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
}
if (rev.pending.nr == 1) {
- rev.pending.objects[0].item->flags |= UNINTERESTING;
- add_head(&rev);
+ if (rev.max_count < 0) {
+ rev.pending.objects[0].item->flags |= UNINTERESTING;
+ add_head(&rev);
+ }
+ /* Otherwise, it is "format-patch -22 HEAD", and
+ * get_revision() would return only the specified count.
+ */
}
if (ignore_if_in_upstream)