<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:dbates&#64;webkit.org" title="Daniel Bates &lt;dbates&#64;webkit.org&gt;"> <span class="fn">Daniel Bates</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use git's -C flag when possible in VCSUtils.pm"
   href="https://bugs.webkit.org/show_bug.cgi?id=169003">bug 169003</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #303006 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use git's -C flag when possible in VCSUtils.pm"
   href="https://bugs.webkit.org/show_bug.cgi?id=169003#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use git's -C flag when possible in VCSUtils.pm"
   href="https://bugs.webkit.org/show_bug.cgi?id=169003">bug 169003</a>
              from <span class="vcard"><a class="email" href="mailto:dbates&#64;webkit.org" title="Daniel Bates &lt;dbates&#64;webkit.org&gt;"> <span class="fn">Daniel Bates</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=303006&amp;action=diff" name="attach_303006" title="Patch">attachment 303006</a> <a href="attachment.cgi?id=303006&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=303006&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=303006&amp;action=review</a>

Please fix up the Git cases in VCSUtils::svn{InfoForPath, RevisionForDirectory}() to use &quot;git -C&quot; instead of changing directories before invoking git before landing this change.

<span class="quote">&gt; Tools/ChangeLog:3
&gt; +        Use the git -C flag where appropriate to avoid changing directories.</span >

This line should be the bug title. The bug description should be below the &quot;Reviewed by&quot; line.

<span class="quote">&gt; Tools/Scripts/VCSUtils.pm:226
&gt; +    return system(&quot;git -C $dir rev-parse &gt; &quot; . File::Spec-&gt;devnull() . &quot; 2&gt;&amp;1&quot;) == 0;</span >

We should put surround the value of $dir in single quotes so as to support paths that contain spaces. I also do not see the need to abbreviate the word directory to dir. I suggest we take this opportunity to rename the local variable to $directory.

<span class="quote">&gt; Tools/Scripts/VCSUtils.pm:244
&gt; +    my $output = `git -C $directory config --get svn-remote.svn.fetch 2&gt;&amp; 1`;</span >

This change breaks this code when $directory contains a space character(s) since this form of system() will invoke the specified string using the shell and the shell will interpret a space character as the delimiter between command line arguments. One way to fix this is to surround $directory in single quotes.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>