{"thread":{"id":"3002","subject":"[PATCH 6/7] Add an optional limit to git-formatpatch","startedAt":"2006-01-08T00:40:59Z","lastAt":"2006-01-08T09:30:11Z","messageCount":2,"participants":["Yann Dirson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"14282","messageId":"20060108004059.GN1113@nowhere.earth","threadId":"3002","inReplyTo":null,"subject":"[PATCH 6/7] Add an optional limit to git-formatpatch","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-01-08T00:40:59Z","receivedAt":"2006-01-08T00:40:59Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"We may not want to format all patches since the merge base.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n\n\n---\n\n git-format-patch.sh |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\na0f52fc065de2bdca4f8e598d4a8a743d183d4d9\ndiff --git a/git-format-patch.sh b/git-format-patch.sh\nindex 0948f1f..6a0d331 100755\n--- a/git-format-patch.sh\n+++ b/git-format-patch.sh\n@@ -30,6 +30,7 @@ diff_opts=\n LF='\n '\n \n+limit=\n outdir=./\n while case \"$#\" in 0) break;; esac\n do\n@@ -45,6 +46,11 @@ do\n     -k|--k|--ke|--kee|--keep|--keep-|--keep-s|--keep-su|--keep-sub|\\\n     --keep-subj|--keep-subje|--keep-subjec|--keep-subject)\n     keep_subject=t ;;\n+    -l=|--l=|--li=|--lim=|--limi=|--limit=)\n+    limit=`expr \"$1\" : '-[^=]*=\\(.*\\)'` ;;\n+    -l|--l|--li|--lim|--limi|--limit)\n+    case \"$#\" in 1) usage ;; esac; shift\n+    limit=\"$1\" ;;\n     -n|--n|--nu|--num|--numb|--numbe|--number|--numbere|--numbered)\n     numbered=t ;;\n     -s|--s|--si|--sig|--sign|--signo|--signof|--signoff)\n@@ -136,7 +142,7 @@ do\n \t\tdie \"Not a valid rev $rev1 ($revpair)\"\n \tgit-rev-parse --verify \"$rev2^0\" >/dev/null 2>&1 ||\n \t\tdie \"Not a valid rev $rev2 ($revpair)\"\n-\tgit-cherry -v \"$rev1\" \"$rev2\" |\n+\tgit-cherry -v \"$rev1\" \"$rev2\" $limit |\n \twhile read sign rev comment\n \tdo\n \t\tcase \"$sign\" in\n-- \n1.0.6-g8ecb\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"14298","messageId":"7vpsn312zg.fsf@assigned-by-dhcp.cox.net","threadId":"3002","inReplyTo":"20060108004059.GN1113@nowhere.earth","subject":"Re: [PATCH 6/7] Add an optional limit to git-formatpatch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-08T09:30:11Z","receivedAt":"2006-01-08T09:30:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> We may not want to format all patches since the merge base.\n\nI am unsure about this one for a few reasons.\n\n - If you have:\n\n           topic~3--topic~2--topic~1--topic\n          /      \n\tMB--*--*--*--upstream\n\n   and you do \"not want to format all patches since the merge\n   base\", instead of \"format-patch --limit=topic~2 master topic\",\n   you could just say \"format-patch topic~2 topic\", so this\n   feature seems unnecessary.  Maybe I am not reading you right.\n\n - Even if the idea of having limit makes sense, only one limit\n   can be specified, but you can have multiple (upstream,mine)\n   pairs.  Your --limit applies the single limit to all of them.\n   I am not sure if that makes sense either.\n\n   I'd expect the limit value to be per (upstream,mine) pair,\n   making \"# Now we have what we want in $@\" for-loop to iterate\n   over (upstream,mine,limit) 3-tuples.\n\n   Internally an (upsteam,mine) pair is canonicalized to be a\n   single string \"upstream..mine\", so extending the canonical\n   syntax somehow, say, \"upstream..mine..limit\" where empty\n   \"limit\" means \"use the merge base\", might make sense.  I\n   dunno.\n\n - One thing that comes to mind is to deal with this structure:\n\n         topic~5--topic~4--topic~3--topic~2--topic~1--topic\n       /                  /\n      Z--*--*--*--*--*--MB--*--*--*--upstream\n\n   and you do want to include commits older than topic~3 because\n   they have not been picked up by the upstream.  In such a\n   scenario, specifying commit Z as the \"limit\" may make sense.\n   It is not \"limit\", but is what ASCII drawing in git-cherry\n   calls \"fork-point\".  Is that what you are doing (the commit\n   log suggests otherwise and you want to get less than what\n   merge base gives you)?\n"}]}