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

Show non default branch in git status #205

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
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
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
Loading