<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:dbates@webkit.org" title="Daniel Bates <dbates@webkit.org>"> <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@webkit.org" title="Daniel Bates <dbates@webkit.org>"> <span class="fn">Daniel Bates</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=303006&action=diff" name="attach_303006" title="Patch">attachment 303006</a> <a href="attachment.cgi?id=303006&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=303006&action=review">https://bugs.webkit.org/attachment.cgi?id=303006&action=review</a>
Please fix up the Git cases in VCSUtils::svn{InfoForPath, RevisionForDirectory}() to use "git -C" instead of changing directories before invoking git before landing this change.
<span class="quote">> Tools/ChangeLog:3
> + 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 "Reviewed by" line.
<span class="quote">> Tools/Scripts/VCSUtils.pm:226
> + return system("git -C $dir rev-parse > " . File::Spec->devnull() . " 2>&1") == 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">> Tools/Scripts/VCSUtils.pm:244
> + my $output = `git -C $directory config --get svn-remote.svn.fetch 2>& 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>