git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/7] Add an optional limit to git-formatpatch

From
Yann Dirson <ydirson@altern.org>
Date
Jan 8, 2006, 00:40 UTC
Message-ID
<20060108004059.GN1113@nowhere.earth>
We may not want to format all patches since the merge base.
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 git-format-patch.sh |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
a0f52fc065de2bdca4f8e598d4a8a743d183d4d9
diff --git a/git-format-patch.sh b/git-format-patch.sh
index 0948f1f..6a0d331 100755
--- a/git-format-patch.sh
+++ b/git-format-patch.sh
@@ -30,6 +30,7 @@ diff_opts=
 LF='
 '
 
+limit=
 outdir=./
 while case "$#" in 0) break;; esac
 do
@@ -45,6 +46,11 @@ do
     -k|--k|--ke|--kee|--keep|--keep-|--keep-s|--keep-su|--keep-sub|\
     --keep-subj|--keep-subje|--keep-subjec|--keep-subject)
     keep_subject=t ;;
+    -l=|--l=|--li=|--lim=|--limi=|--limit=)
+    limit=`expr "$1" : '-[^=]*=\(.*\)'` ;;
+    -l|--l|--li|--lim|--limi|--limit)
+    case "$#" in 1) usage ;; esac; shift
+    limit="$1" ;;
     -n|--n|--nu|--num|--numb|--numbe|--number|--numbere|--numbered)
     numbered=t ;;
     -s|--s|--si|--sig|--sign|--signo|--signof|--signoff)
@@ -136,7 +142,7 @@ do
 		die "Not a valid rev $rev1 ($revpair)"
 	git-rev-parse --verify "$rev2^0" >/dev/null 2>&1 ||
 		die "Not a valid rev $rev2 ($revpair)"
-	git-cherry -v "$rev1" "$rev2" |
+	git-cherry -v "$rev1" "$rev2" $limit |
 	while read sign rev comment
 	do
 		case "$sign" in
-- 
1.0.6-g8ecb

-- 
Yann Dirson    <ydirson@altern.org> |
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>
Next: Junio C Hamano
Message 1 of 2 in “Add an optional limit to git-formatpatch”
  1. 6/7 Add an optional limit to git-formatpatchYann Dirson, Jan 8, 2006
  2. Junio C HamanoJan 8, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.