Skip to content

Commit

Permalink
Show non default branch in git status (#205)
Browse files Browse the repository at this point in the history
Co-authored-by: André L F S Bacci <[email protected]>
  • Loading branch information
alfsb and André L F S Bacci authored Dec 13, 2024
1 parent 0ef7804 commit 7edcafd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,16 +643,20 @@ function getFileModificationHistory(): array {
$repos[$ac['LANG']] = "{$ac['rootdir']}/{$ac['LANG']}";
$repos = array_unique($repos);

foreach ($repos as $name => $path)
$output = "";
foreach ( $repos as $name => $path )
{
$driveSwitch = is_windows() ? '/d' : '';
$output = str_pad( "$name:" , 10 );
$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";
$path = escapeshellarg( $path );
$branch = trim( `git -C $path rev-parse --abbrev-ref HEAD` );
$branch = $branch == "master" ? "" : " (branch $branch)";
$output .= str_pad( "$name:" , 10 );
$output .= rtrim( `git -C $path rev-parse HEAD` ?? "" ) . "$branch\n";
$output .= rtrim( `git -C $path status -s` ?? "" ) . "\n";
$output .= rtrim( `git -C $path for-each-ref --format="%(push:track)" refs/heads` ?? "" ) . "\n";
}
while( str_contains( $output , "\n\n" ) )
$output = str_replace( "\n\n" , "\n" , $output );
echo "\n" , trim( $output ) . "\n\n";

foreach ($infiles as $in) {
$in = chop("{$ac['basedir']}/{$in}");
Expand Down
2 changes: 1 addition & 1 deletion scripts/genPHP_INI_ENTRY.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function findINI($fname) {/*{{{*/
$data = file_get_contents($fname);
//$re = '/PHP_INI_ENTRY\("([^"]+)",\s+"([^"]+)",\s+([A-Z_]),/';
$re = '/(PHP_INI_ENTRY|PHP_INI_ENTRY_EX|PHP_INI_BOOLEAN)\(([^)]+)/';
preg_match_all($re, $data, &$matches);
preg_match_all($re, $data, $matches);
$re2 = '/"([^"]+)",\s*"([^"]+)",\s*([A-Z_]+)/';

foreach ($matches[2] as $match) {
Expand Down

0 comments on commit 7edcafd

Please sign in to comment.