git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-format-patch -3
@ 2007-01-17 21:35 Junio C Hamano
  2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
  2007-01-18  1:25 ` [PATCH] git-format-patch -3 Johannes Schindelin
  0 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2007-01-17 21:35 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

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>
---

 * I think this is incompatible with --ignore-if-upstream, which
   I haven't bothered to look into yet.

   Likes, dislikes?

 builtin-log.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 1cd9d3f..9453e6d 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)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-01-18 15:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-17 21:35 [PATCH] git-format-patch -3 Junio C Hamano
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
2007-01-17 22:41   ` [PATCH] git-format-patch: make --binary on " Junio C Hamano
2007-01-17 23:06     ` [PATCH - todo] Changes to e-mailed patch handling in v1.5.0 Junio C Hamano
2007-01-18  8:18       ` Andy Parkins
2007-01-18 15:13         ` Brian Gernhardt
2007-01-18  1:04   ` [PATCH] Add --summary to git-format-patch by default Shawn O. Pearce
2007-01-18  1:25 ` [PATCH] git-format-patch -3 Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).