Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git refs not showing on Windows #116

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
function usage() // {{{
{
global $acd;

echo <<<HELPCHUNK
configure.php configures this package to adapt to many kinds of systems, and PhD
builds too.
Expand Down Expand Up @@ -96,7 +96,7 @@ function is_windows() {
function checking($for) // {{{
{
global $ac;

if ($ac['quiet'] != 'yes') {
echo "Checking {$for}... ";
flush();
Expand All @@ -106,7 +106,7 @@ function checking($for) // {{{
function checkerror($msg) // {{{
{
global $ac;

if ($ac['quiet'] != 'yes') {
echo "\n";
}
Expand All @@ -117,7 +117,7 @@ function checkerror($msg) // {{{
function checkvalue($v) // {{{
{
global $ac;

if ($ac['quiet'] != 'yes') {
echo "{$v}\n";
}
Expand Down Expand Up @@ -390,7 +390,7 @@ function generate_sources_file() // {{{
} else {
continue;
}

$overridden_settings[] = strtoupper($o);
switch ($o) {
case 'h':
Expand Down Expand Up @@ -478,7 +478,7 @@ function generate_sources_file() // {{{
case 'basedir':
$ac['basedir'] = $v;
break;

case 'output':
$ac['OUTPUT_FILENAME'] = $v;
break;
Expand Down Expand Up @@ -620,10 +620,11 @@ function generate_sources_file() // {{{

foreach ($repos as $name => $path)
{
$driveSwitch = is_windows() ? '/d' : '';
$output = str_pad( "$name:" , 10 );
$output .= `cd $path; git rev-parse HEAD;`;
$output .= `cd $path; git status -s;`;
$output .= `cd $path; git for-each-ref --format="%(push:track)" refs/heads`;
$output .= `cd $driveSwitch $path && git rev-parse HEAD`;
$output .= `cd $driveSwitch $path && git status -s`;
$output .= `cd $driveSwitch $path && git for-each-ref --format="%(push:track)" refs/heads`;
echo trim($output) . "\n";
}
echo "\n";
Expand Down Expand Up @@ -793,7 +794,7 @@ function generate_sources_file() // {{{
echo "done.\n";
echo "Partial manual saved to {$filename}. To build it, run 'phd -d {$filename}'\n";
exit(0);
} // }}}
} // }}}

$mxml = $ac["OUTPUT_FILENAME"];
if ($dom->validate()) {
Expand Down Expand Up @@ -839,7 +840,7 @@ function generate_sources_file() // {{{
echo "\nThe document didn't validate, ";

// Allow the .manual.xml file to be created, even if it is not valid.
if ($ac['FORCE_DOM_SAVE'] == 'yes') {
if ($ac['FORCE_DOM_SAVE'] == 'yes') {
printf("writing %s anyway, and ", basename($ac["OUTPUT_FILENAME"]));
if ($ac["SEGFAULT_SPEED"] == "yes") {
$t = $dom->doctype;
Expand Down