{"thread":{"id":"3443","subject":"PATCH: simplify calls to git programs in git-fmt-merge-msg","startedAt":"2006-02-23T10:26:46Z","lastAt":"2006-02-23T12:40:59Z","messageCount":5,"participants":["Alex Riesen","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"16609","messageId":"81b0412b0602230226j12e88682h303d466a273bec09@mail.gmail.com","threadId":"3443","inReplyTo":null,"subject":"PATCH: simplify calls to git programs in git-fmt-merge-msg","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-02-23T10:26:46Z","receivedAt":"2006-02-23T10:26:46Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"It also makes it work on ActiveState Perl.\n\n\n---\n\n git-fmt-merge-msg.perl |   31 +++++--------------------------\n 1 files changed, 5 insertions(+), 26 deletions(-)\n\n1c0dd861fa32017cf7bc4226bfa54d390a3fb91e\ndiff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl\nindex c13af48..dae383f 100755\n--- a/git-fmt-merge-msg.perl\n+++ b/git-fmt-merge-msg.perl\n@@ -28,28 +28,13 @@ sub andjoin {\n }\n \n sub repoconfig {\n-\tmy $val;\n-\teval {\n-\t\tmy $pid = open(my $fh, '-|');\n-\t\tif (!$pid) {\n-\t\t\texec('git-repo-config', '--get', 'merge.summary');\n-\t\t}\n-\t\t($val) = <$fh>;\n-\t\tclose $fh;\n-\t};\n+\tmy ($val) = qx{git-repo-config --get merge.summary};\n \treturn $val;\n }\n \n sub current_branch {\n-\tmy $fh;\n-\tmy $pid = open($fh, '-|');\n-\tdie \"$!\" unless defined $pid;\n-\tif (!$pid) {\n-\t    exec('git-symbolic-ref', 'HEAD') or die \"$!\";\n-\t}\n-\tmy ($bra) = <$fh>;\n+\tmy ($bra) = qx{git-symbolic-ref HEAD};\n \tchomp($bra);\n-\tclose $fh or die \"$!\";\n \t$bra =~ s|^refs/heads/||;\n \tif ($bra ne 'master') {\n \t\t$bra = \" into $bra\";\n@@ -61,18 +46,12 @@ sub current_branch {\n \n sub shortlog {\n \tmy ($tip) = @_;\n-\tmy ($fh, @result);\n-\tmy $pid = open($fh, '-|');\n-\tdie \"$!\" unless defined $pid;\n-\tif (!$pid) {\n-\t    exec('git-log', '--topo-order',\n-\t\t '--pretty=oneline', $tip, '^HEAD') or die \"$!\";\n-\t}\n-\twhile (<$fh>) {\n+\tmy @result;\n+\tforeach ( qx{git-log --topo-order --pretty=oneline $tip ^HEAD} ) {\n \t\ts/^[0-9a-f]{40}\\s+//;\n \t\tpush @result, $_;\n \t}\n-\tclose $fh or die \"$!\";\n+\tdie \"git-log failed\\n\" if $?;\n \treturn @result;\n }\n \n-- \n1.2.3.g6ae0e\n\n"},{"id":"16610","messageId":"7vslqaicqj.fsf@assigned-by-dhcp.cox.net","threadId":"3443","inReplyTo":"81b0412b0602230226j12e88682h303d466a273bec09@mail.gmail.com","subject":"Re: PATCH: simplify calls to git programs in git-fmt-merge-msg","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-23T10:35:48Z","receivedAt":"2006-02-23T10:35:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alex Riesen\" <raa.lkml@gmail.com> writes:\n\n> It also makes it work on ActiveState Perl.\n>\n> ---\n\nActiveState or not, this simplification is pretty much welcomed.\nThe only problem I _might_ have later is with shortlog, though I\nhave not looked at it closely yet.\n\nThanks.\n"},{"id":"16611","messageId":"81b0412b0602230257h3713e6e8ud11c6aa9547b0d37@mail.gmail.com","threadId":"3443","inReplyTo":"7vslqaicqj.fsf@assigned-by-dhcp.cox.net","subject":"Re: PATCH: simplify calls to git programs in git-fmt-merge-msg","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-02-23T10:57:24Z","receivedAt":"2006-02-23T10:57:24Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 2/23/06, Junio C Hamano <junkio@cox.net> wrote:\n>\n> > It also makes it work on ActiveState Perl.\n> >\n> > ---\n>\n> ActiveState or not, this simplification is pretty much welcomed.\n> The only problem I _might_ have later is with shortlog, though I\n> have not looked at it closely yet.\n\nI tested it a bit.\nI suppose you can have two following concerns there:\n- $tip - it seem to be always an sha1\n- perl can decide to fetch whole output of git-log into memory.\n  I heard it optimizes such cases into reading only when needed...\n"},{"id":"16613","messageId":"Pine.LNX.4.63.0602231335420.3726@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3443","inReplyTo":"81b0412b0602230226j12e88682h303d466a273bec09@mail.gmail.com","subject":"Re: PATCH: simplify calls to git programs in git-fmt-merge-msg","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-02-23T12:36:22Z","receivedAt":"2006-02-23T12:36:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 23 Feb 2006, Alex Riesen wrote:\n\n> It also makes it work on ActiveState Perl.\n\nThank you for teaching me this very valuable construct: qx{ ... }.\n\nCiao,\nDscho\n"},{"id":"16614","messageId":"81b0412b0602230440j24ab1ecfwf35921236b905f2b@mail.gmail.com","threadId":"3443","inReplyTo":"Pine.LNX.4.63.0602231335420.3726@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: PATCH: simplify calls to git programs in git-fmt-merge-msg","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-02-23T12:40:59Z","receivedAt":"2006-02-23T12:40:59Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 2/23/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> > It also makes it work on ActiveState Perl.\n>\n> Thank you for teaching me this very valuable construct: qx{ ... }.\n\nYou're welcome. That's the same as shells old `` (backquote).\n"}]}