feat: add git blame section
This commit is contained in:
@@ -41,8 +41,8 @@ if (-not (Test-Path "answers.md")) {
|
||||
$answers = Get-Content "answers.md" -Raw
|
||||
$answersLower = $answers.ToLower()
|
||||
|
||||
# Check 1: Contains "5" or "five" for commit count
|
||||
if ($answersLower -match "5|five") {
|
||||
# Check 1: Contains "6" or "six" for commit count
|
||||
if ($answersLower -match "6|six") {
|
||||
Write-Host "[PASS] Correct commit count found" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "[FAIL] Commit count not found or incorrect" -ForegroundColor Red
|
||||
@@ -93,12 +93,12 @@ if (-not (Test-Path "answers.md")) {
|
||||
$allChecksPassed = $false
|
||||
}
|
||||
|
||||
# Check 6: Some mention of changes between commits (flexible check)
|
||||
if ($answersLower -match "database|connect|disconnect|import|added|validation|error") {
|
||||
Write-Host "[PASS] Changes to app.py between commits described" -ForegroundColor Green
|
||||
# Check 6: Contains "guilty@email.com" for git blame challenge
|
||||
if ($answersLower -match "guilty@email\.com") {
|
||||
Write-Host "[PASS] Correct email address found using git blame!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "[FAIL] Changes to app.py between commits not described" -ForegroundColor Red
|
||||
Write-Host "[HINT] Use 'git diff <commit2> <commit4> app.py' to see changes between specific commits" -ForegroundColor Yellow
|
||||
Write-Host "[FAIL] Guilty developer's email not found" -ForegroundColor Red
|
||||
Write-Host "[HINT] Use 'git blame -e app.py' to see who changed each line with email addresses" -ForegroundColor Yellow
|
||||
$allChecksPassed = $false
|
||||
}
|
||||
}
|
||||
@@ -118,6 +118,7 @@ if ($allChecksPassed) {
|
||||
Write-Host " - See which files changed in commits" -ForegroundColor White
|
||||
Write-Host " - Check staged changes with git diff --staged" -ForegroundColor White
|
||||
Write-Host " - Compare changes between specific commits with git diff" -ForegroundColor White
|
||||
Write-Host " - Track down who made changes with git blame" -ForegroundColor White
|
||||
Write-Host "`nReady for the next module!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user