{"thread":{"id":"20249","subject":"[RFC] request-pull with diff body itself","startedAt":"2009-07-27T19:53:57Z","lastAt":"2009-07-28T06:00:08Z","messageCount":5,"participants":["Cyrill Gorcunov","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118899","messageId":"20090727195357.GE17942@lenovo","threadId":"20249","inReplyTo":null,"subject":"[RFC] request-pull with diff body itself","fromName":"Cyrill Gorcunov","fromEmail":"gorcunov@gmail.com","sentAt":"2009-07-27T19:53:57Z","receivedAt":"2009-07-27T19:53:57Z","isPatch":false,"sender":{"key":"gorcunov@gmail.com","avatar":"https://gravatar.com/avatar/b9d3eb8ea4efbd95564cedde5bf279ef8f36091cf61fac090c8cb75cc4ad6f8b?d=mp&s=160"},"body":"Here is rfc in a sake of having ability to produce\ndiff body in small series of changes in request-pull.\nwe could use \">>\" here and append diff by hands but\nadding \"-p\" option seems more comfortable.\n\nDunno, just a thought.\n\nPlease CC me, I'm not subscribed.\n\n\t-- Cyrill\n---\n[RFC] request-pull -- produce long diff if needed\n\nAllow git request-pull to append diff body into\npull request. It's really useful for small series\nof commits.\n\nSigned-off-by: Cyrill Gorcunov <gorcunov@gmail.com>\n---\n\nThis is just an RFC -- so if you don't like it feel\nfree to just drop. I found useful to have an ability\nto pass additional \"-p\" option and have diff body in\nrequest.\n\n git-request-pull.sh |   18 +++++++++++++++++-\n 1 file changed, 17 insertions(+), 1 deletion(-)\n\nIndex: git.git/git-request-pull.sh\n=====================================================================\n--- git.git.orig/git-request-pull.sh\n+++ git.git/git-request-pull.sh\n@@ -4,7 +4,7 @@\n # This file is licensed under the GPL v2, or a later version\n # at the discretion of Linus Torvalds.\n \n-USAGE='<start> <url> [<end>]'\n+USAGE='[-p] <start> <url> [<end>]'\n LONG_USAGE='Summarizes the changes between two commits to the standard output,\n and includes the given URL in the generated summary.'\n SUBDIRECTORY_OK='Yes'\n@@ -15,6 +15,16 @@ OPTIONS_SPEC=\n GIT_PAGER=\n export GIT_PAGER\n \n+usediff=\"no\"\n+if [ $# -eq 4 ]; then\n+\tif [ $1 = \"-p\" ]; then\n+\t\tusediff=\"yes\"\n+\t\tshift\n+\telse\n+\t\tusage\n+\tfi\n+fi\n+\n base=$1\n url=$2\n head=${3-HEAD}\n@@ -55,4 +65,10 @@ echo\n \n git shortlog ^$baserev $headrev\n git diff -M --stat --summary $merge_base $headrev\n+\n+if [ \"$usediff\" = \"yes\" ]; then\n+\techo \"---\"\n+\tgit diff -M -p $merge_base $headrev\n+fi\n+\n exit $status\n"},{"id":"118900","messageId":"7vws5tg8fw.fsf@alter.siamese.dyndns.org","threadId":"20249","inReplyTo":"20090727195357.GE17942@lenovo","subject":"Re: [RFC] request-pull with diff body itself","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-27T20:46:59Z","receivedAt":"2009-07-27T20:46:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Cyrill Gorcunov <gorcunov@gmail.com> writes:\n\n> Here is rfc in a sake of having ability to produce\n> diff body in small series of changes in request-pull.\n> we could use \">>\" here and append diff by hands but\n> adding \"-p\" option seems more comfortable.\n>\n> Dunno, just a thought.\n\nI think this is a useful thing to add, as I think I've seen some\nrequest-pull actually made with the patch text, most likely by hand.\n\n>  git shortlog ^$baserev $headrev\n>  git diff -M --stat --summary $merge_base $headrev\n> +\n> +if [ \"$usediff\" = \"yes\" ]; then\n> +\techo \"---\"\n> +\tgit diff -M -p $merge_base $headrev\n> +fi\n\nYou can just use a single \"git diff\" invocation here,\n\n\tgit diff -M --stat --summary $usediff $merge_base $headrev\n\nand set up \"$usediff\" to be either empty or -p in the option parsing part.\n"},{"id":"118902","messageId":"aa79d98a0907271356l51111uac0884cf148f434f@mail.gmail.com","threadId":"20249","inReplyTo":"7vws5tg8fw.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC] request-pull with diff body itself","fromName":"Cyrill Gorcunov","fromEmail":"gorcunov@gmail.com","sentAt":"2009-07-27T20:56:10Z","receivedAt":"2009-07-27T20:56:10Z","isPatch":false,"sender":{"key":"gorcunov@gmail.com","avatar":"https://gravatar.com/avatar/b9d3eb8ea4efbd95564cedde5bf279ef8f36091cf61fac090c8cb75cc4ad6f8b?d=mp&s=160"},"body":"On 7/28/09, Junio C Hamano <gitster@pobox.com> wrote:\n> Cyrill Gorcunov <gorcunov@gmail.com> writes:\n>\n>> Here is rfc in a sake of having ability to produce\n>> diff body in small series of changes in request-pull.\n>> we could use \">>\" here and append diff by hands but\n>> adding \"-p\" option seems more comfortable.\n>>\n>> Dunno, just a thought.\n>\n> I think this is a useful thing to add, as I think I've seen some\n> request-pull actually made with the patch text, most likely by hand.\n>\n>>  git shortlog ^$baserev $headrev\n>>  git diff -M --stat --summary $merge_base $headrev\n>> +\n>> +if [ \"$usediff\" = \"yes\" ]; then\n>> +\techo \"---\"\n>> +\tgit diff -M -p $merge_base $headrev\n>> +fi\n>\n> You can just use a single \"git diff\" invocation here,\n>\n> \tgit diff -M --stat --summary $usediff $merge_base $headrev\n>\n> and set up \"$usediff\" to be either empty or -p in the option parsing part.\n>\nyeah, indeed, thanks for the hint Junio!\nWill post an updated patch in a day or so ( as only get back my laptop\nback). Or maybe someone could make it faster then me ;)\n"},{"id":"118908","messageId":"7vtz0xerzg.fsf@alter.siamese.dyndns.org","threadId":"20249","inReplyTo":"aa79d98a0907271356l51111uac0884cf148f434f@mail.gmail.com","subject":"Re: [RFC] request-pull with diff body itself","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-27T21:27:47Z","receivedAt":"2009-07-27T21:27:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Cyrill Gorcunov <gorcunov@gmail.com> writes:\n\n> Will post an updated patch in a day or so ( as only get back my laptop\n> back). Or maybe someone could make it faster then me ;)\n\nLike this, perhaps.\n\n git-request-pull.sh |   24 ++++++++++++++++++++++--\n 1 files changed, 22 insertions(+), 2 deletions(-)\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex 5917773..5c1121c 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -8,13 +8,33 @@ USAGE='<start> <url> [<end>]'\n LONG_USAGE='Summarizes the changes between two commits to the standard output,\n and includes the given URL in the generated summary.'\n SUBDIRECTORY_OK='Yes'\n-OPTIONS_SPEC=\n+OPTIONS_SPEC='git request-pull [options] start url [end]\n+--\n+p    show patch text as well\n+'\n+\n . git-sh-setup\n . git-parse-remote\n \n GIT_PAGER=\n export GIT_PAGER\n \n+patch=\n+while\tcase \"$#\" in 0) break ;; esac\n+do\n+\tcase \"$1\" in\n+\t-p)\n+\t\tpatch=-p ;;\n+\t--)\n+\t\tshift; break ;;\n+\t-*)\n+\t\tusage ;;\n+\t*)\n+\t\tbreak ;;\n+\tesac\n+\tshift\n+done\n+\n base=$1\n url=$2\n head=${3-HEAD}\n@@ -54,5 +74,5 @@ echo \"  $url $branch\"\n echo\n \n git shortlog ^$baserev $headrev\n-git diff -M --stat --summary $merge_base $headrev\n+git diff -M --stat --summary $patch $merge_base..$headrev\n exit $status\n"},{"id":"118921","messageId":"20090728060008.GA4799@lenovo","threadId":"20249","inReplyTo":"7vtz0xerzg.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC] request-pull with diff body itself","fromName":"Cyrill Gorcunov","fromEmail":"gorcunov@gmail.com","sentAt":"2009-07-28T06:00:08Z","receivedAt":"2009-07-28T06:00:08Z","isPatch":false,"sender":{"key":"gorcunov@gmail.com","avatar":"https://gravatar.com/avatar/b9d3eb8ea4efbd95564cedde5bf279ef8f36091cf61fac090c8cb75cc4ad6f8b?d=mp&s=160"},"body":"[Junio C Hamano - Mon, Jul 27, 2009 at 02:27:47PM -0700]\n| Cyrill Gorcunov <gorcunov@gmail.com> writes:\n| \n| > Will post an updated patch in a day or so ( as only get back my laptop\n| > back). Or maybe someone could make it faster then me ;)\n| \n| Like this, perhaps.\n|\n...\n\nYes, Junio, thanks! Please merge it into git repo\n(if noone objects).\n\n\t-- Cyrill\n"}]}