Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
104677d
Initial minimal implementation of new scanner
twaugh Sep 5, 2025
6a77ea1
New scanner: add header parsing
twaugh Sep 6, 2025
b630c27
New scanner: code clean-up
twaugh Sep 6, 2025
03ba791
New scanner: proper hunk parsing
twaugh Sep 7, 2025
7fde4a4
New scanner: some code dedupiclication
twaugh Sep 7, 2025
6bab015
New scanner: additional testing, and integrate into 'make check'
twaugh Sep 7, 2025
4e3bb69
New scanner: better recognition of git diff format
twaugh Sep 7, 2025
f5835d5
New scanner: context diff support
twaugh Sep 7, 2025
b23a9bb
New scanner: line number tracking fix
twaugh Sep 8, 2025
fb03717
New scanner: fix for git diff without hunks
twaugh Sep 8, 2025
2cfb1ec
Implement some utility functions for file existence/status
twaugh Sep 8, 2025
c7eb795
New scanner: create minimal lsdiff implementation
twaugh Sep 9, 2025
5b427d6
New scanner: fix build
twaugh Sep 9, 2025
6284f80
New scanner: some parser fixes
twaugh Sep 9, 2025
09d2e97
New scanner: fix unit test
twaugh Sep 9, 2025
9a9877a
New scanner: more implementation for lsdiff
twaugh Sep 9, 2025
3610785
Fix stray comment
twaugh Sep 9, 2025
e1755bb
New scanner: fix confusion about lines starting '***'
twaugh Sep 9, 2025
f8f0584
New scanner: fix for parsing git format diffs without hunks
twaugh Sep 9, 2025
244ca9e
New scanner: fix unit test, and buffer headers to emit a single HEADE…
twaugh Sep 9, 2025
9976b78
New scanner: more robust timestamp parsing
twaugh Sep 9, 2025
cc54cf0
New scanner: lsdiff compatibility for 'standard input'
twaugh Sep 9, 2025
c314495
New scanner: explicit filename candidate preferences for lsdiff
twaugh Sep 9, 2025
8fb52ee
New lsdiff: fix filename selection to match original implementation
twaugh Sep 10, 2025
7604a90
New lsdiff: Handle -E for unified diff format
twaugh Sep 10, 2025
3ab9193
New scanner: fix context/unified diff format confusion
twaugh Sep 10, 2025
be78e67
New lsdiff: a fix for -E handling with context diff format
twaugh Sep 10, 2025
75d061a
New scanner: add scanner debug tool for debugging
twaugh Sep 10, 2025
809cfca
New scanner: fixes for content diff format
twaugh Sep 10, 2025
eada198
New lsdiff: handle -p without -i/-x
twaugh Sep 10, 2025
96b252c
New lsdiff: fix compile warning
twaugh Sep 10, 2025
a0220f0
New scanner: fix content diff separator parsing
twaugh Sep 10, 2025
690918b
New lsdiff: fix cumulative line number tracking
twaugh Sep 10, 2025
9f2efaa
New lsdiff: implement --addprefix
twaugh Sep 10, 2025
9c972fa
New scanner: fix handling of git renames/copies/operations without hunks
twaugh Sep 10, 2025
7ec7a8d
New scanner: another fix for git diff format
twaugh Sep 10, 2025
5157d7e
New scanner: fix for pure mode changes
twaugh Sep 10, 2025
ba6db1a
New scanner: fix context diff format parsing with empty files
twaugh Sep 11, 2025
472ecf4
New scanner: fix for line number reporting with context diff format
twaugh Sep 11, 2025
0fd6b53
Prefer source name when choosing best name (diff.c, lsdiff.c)
twaugh Sep 12, 2025
a281ba5
Make scanner test Makefile inherit flags
twaugh Sep 12, 2025
4849e8e
Add scanner-based lsdiff testing to CI
twaugh Sep 12, 2025
eaf2158
Fix scanner tests for 'make distcheck'
twaugh Sep 12, 2025
232bae0
Whitespace changes
twaugh Sep 16, 2025
3e70f1e
Prevent integer overflow in scanner_context_buffer_add
twaugh Sep 16, 2025
3180bf0
Cosmetic changes
twaugh Sep 16, 2025
b5545af
New parser: emit accumulated headers when parsing fails
twaugh Sep 16, 2025
96fe4e2
New lsdiff: better filename handling for git rename/copy operations
twaugh Sep 16, 2025
053d98a
New lsdiff: clean up some comments
twaugh Sep 16, 2025
9fbcf8e
New lsdiff: add file range exclusion and a test for it
twaugh Sep 16, 2025
e70f8f0
New parser: fix a memory management issue from emitting bad headers a…
twaugh Sep 16, 2025
256fe13
New scanner: prevent integer overflow emitting accumulated headers
twaugh Sep 16, 2025
fe359bf
New parser: stricter input validation
twaugh Sep 17, 2025
ae6381e
New lsdiff: update help text
twaugh Sep 17, 2025
fc81008
New lsdiff: implement -n[v[v]] correctly
twaugh Sep 17, 2025
00cba1c
New lsdiff: implement --lines
twaugh Sep 18, 2025
f68114b
New lsdiff: implement --hunks
twaugh Sep 18, 2025
ea9ffd1
Mark some lsdiff tests as XFAIL only for the filterdiff-based impleme…
twaugh Sep 18, 2025
09383a5
Better documentation in patch_scanner.h
twaugh Sep 18, 2025
9cbe885
New lsdiff: new function for handling pending files
twaugh Sep 19, 2025
0278e1b
New lsdiff: remove code duplication relating to candidate name gathering
twaugh Sep 19, 2025
24ddef2
New parser: additional scanner testing for binary format
twaugh Sep 19, 2025
f5429ee
More lsdiff tests
twaugh Sep 19, 2025
07ad102
New parser: fix some memory leaks
twaugh Sep 19, 2025
48a933d
New lsdiff: fix a memory leak
twaugh Sep 19, 2025
8799825
New parser: add scanner-debug tests
twaugh Sep 19, 2025
35423f1
More lsdiff tests
twaugh Sep 19, 2025
53174e9
New lsdiff: use diff.c git-prefix-stripping function instead of dupli…
twaugh Sep 22, 2025
5382314
New lsdiff: skeleton support for different modes like filterdiff has
twaugh Sep 22, 2025
a3dabfd
Move some common functions from ls.c to patchfilter.c
twaugh Oct 16, 2025
327126e
scanner: simplify patch_hunk_line API with single line field
twaugh Oct 17, 2025
7169527
scanner: fix context diff hunk range parsing bug
twaugh Oct 17, 2025
4685769
build: integrate scanner tests into main build system
twaugh Oct 17, 2025
8f3f1b3
scanner: Add context field to patch_hunk_line for better context diff…
twaugh Oct 17, 2025
4db71a8
scanner: Add clean content field to patch_hunk_line
twaugh Oct 17, 2025
d954b4d
tests: Add scanner tests for context field
twaugh Oct 17, 2025
2c1515b
tests: Add scanner tests for content field
twaugh Oct 17, 2025
c50204a
grepdiff: Implement scanner-based grepdiff functionality
twaugh Oct 17, 2025
ce5465b
grepdiff: Simplify match filter logic and fix output mode behavior
twaugh Oct 17, 2025
c25093b
Create shared infrastructure for patch processing tools
twaugh Oct 17, 2025
f64bfc8
ci: Improve test failure diagnostics and eliminate output truncation
twaugh Oct 17, 2025
2c97a2f
grepdiff: Implement --as-numbered-lines=original-* options for scanne…
twaugh Oct 17, 2025
5858e8b
Refactor ls.c and grep.c to use common option parsing
twaugh Oct 17, 2025
7be3e62
Update README_scanner_debug.md with accurate documentation and examples
twaugh Oct 17, 2025
03e2b59
Fix copyright years and remove inaccurate scanner test documentation
twaugh Oct 17, 2025
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
186 changes: 169 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
coverage: false
configure_flags: "--without-pcre2"

- name: "Ubuntu Scanner-based patchfilter + Coverage"
os: ubuntu
pcre2: true
coverage: true
scanner_patchfilter: true
configure_flags: "--with-pcre2 --enable-scanner-patchfilter"

# Alpine (musl) tests
- name: "Musl with PCRE2"
os: alpine
Expand Down Expand Up @@ -134,6 +141,80 @@ jobs:
- name: Run tests
run: make check

# Re-run failed tests with verbose output for immediate diagnostics
- name: Re-run failed tests with verbose output
if: failure()
run: |
echo "Re-running tests with VERBOSE=1 for better diagnostics..."
VERBOSE=1 make check || true

# Collect test artifacts on failure
- name: Collect test artifacts
if: failure()
run: |
# Create artifacts directory
mkdir -p test-artifacts

# Copy all log files with better organization
find . -name "*.log" -type f | while read logfile; do
# Create directory structure in artifacts
dirname_part=$(dirname "$logfile" | sed 's|^\./||')
mkdir -p "test-artifacts/logs/$dirname_part"
cp "$logfile" "test-artifacts/logs/$logfile"
done

# Copy test-arena with full structure (not just first 20 files)
if [ -d test-arena ]; then
cp -r test-arena test-artifacts/
fi

# Create a summary of what failed
if [ -f test-suite.log ]; then
# Extract failed tests summary
grep -A 5 -B 5 "FAIL\|ERROR" test-suite.log > test-artifacts/failure-summary.txt 2>/dev/null || true

# Extract just the test names that failed
grep "^FAIL\|^ERROR" test-suite.log | cut -d: -f2- > test-artifacts/failed-tests.txt 2>/dev/null || true
fi

# Create a structured failure report
cat > test-artifacts/failure-report.md << 'EOF'
# Test Failure Report

## Build Configuration
- OS: ${{ matrix.os }}
- PCRE2: ${{ matrix.pcre2 }}
- Scanner Patchfilter: ${{ matrix.scanner_patchfilter }}
- Configure Flags: ${{ matrix.configure_flags }}

## Failed Tests
EOF

if [ -f test-artifacts/failed-tests.txt ] && [ -s test-artifacts/failed-tests.txt ]; then
echo "The following tests failed:" >> test-artifacts/failure-report.md
echo '```' >> test-artifacts/failure-report.md
cat test-artifacts/failed-tests.txt >> test-artifacts/failure-report.md
echo '```' >> test-artifacts/failure-report.md
else
echo "No specific test failures found in test-suite.log" >> test-artifacts/failure-report.md
fi

# List all collected artifacts
echo "" >> test-artifacts/failure-report.md
echo "## Collected Artifacts" >> test-artifacts/failure-report.md
echo '```' >> test-artifacts/failure-report.md
find test-artifacts -type f | sort >> test-artifacts/failure-report.md
echo '```' >> test-artifacts/failure-report.md

# Upload test artifacts on failure
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-failure-${{ matrix.name }}-${{ github.run_number }}
path: test-artifacts/
retention-days: 30

# Coverage reporting (only for coverage builds)
- name: Generate coverage report
if: matrix.coverage
Expand Down Expand Up @@ -174,17 +255,43 @@ jobs:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

# Show failures
- name: Show test results on failure
# Show immediate failure summary in logs
- name: Show test failure summary
if: failure()
run: |
echo "=== Test logs ==="
find . -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \;
echo "=== Test arena contents ==="
find test-arena -type f 2>/dev/null | head -20 | while read f; do
echo "=== $f ==="
cat "$f" 2>/dev/null || echo "Cannot read file"
done
echo "=========================================="
echo "TEST FAILURE SUMMARY"
echo "=========================================="
echo "Build: ${{ matrix.name }}"
echo "Configure flags: ${{ matrix.configure_flags }}"
echo ""

# Show test-suite.log summary if it exists
if [ -f test-suite.log ]; then
echo "=== Test Suite Summary ==="
head -20 test-suite.log
echo ""

# Show failed tests specifically
if grep -q "^FAIL\|^ERROR" test-suite.log; then
echo "=== Failed Tests ==="
grep "^FAIL\|^ERROR" test-suite.log || echo "No FAIL/ERROR lines found"
echo ""

# Show details of failed tests
echo "=== Failure Details ==="
grep -A 10 -B 2 "^FAIL\|^ERROR" test-suite.log | head -50
else
echo "No failed tests found in test-suite.log"
fi
else
echo "No test-suite.log found"
fi

echo ""
echo "=========================================="
echo "Full details available in uploaded artifacts"
echo "=========================================="

# Separate distcheck job (doesn't fit well in matrix)
distcheck:
Expand Down Expand Up @@ -216,13 +323,58 @@ jobs:
- name: Build and test distribution
run: make distcheck

- name: Show test results on failure
# Collect distcheck artifacts on failure
- name: Collect distcheck artifacts
if: failure()
run: |
echo "=== Test logs ==="
find . -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \;
echo "=== Test arena contents ==="
find test-arena -type f 2>/dev/null | head -20 | while read f; do
echo "=== $f ==="
cat "$f" 2>/dev/null || echo "Cannot read file"
done
mkdir -p distcheck-artifacts

# Copy all log files
find . -name "*.log" -type f | while read logfile; do
dirname_part=$(dirname "$logfile" | sed 's|^\./||')
mkdir -p "distcheck-artifacts/logs/$dirname_part"
cp "$logfile" "distcheck-artifacts/logs/$logfile"
done

# Copy test-arena if it exists
if [ -d test-arena ]; then
cp -r test-arena distcheck-artifacts/
fi

# Look for distcheck-specific directories
find . -name "patchutils-*" -type d | head -5 | while read distdir; do
if [ -d "$distdir" ]; then
cp -r "$distdir" distcheck-artifacts/ 2>/dev/null || true
fi
done

# Upload distcheck artifacts on failure
- name: Upload distcheck artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: distcheck-failure-${{ github.run_number }}
path: distcheck-artifacts/
retention-days: 30

# Show distcheck failure summary
- name: Show distcheck failure summary
if: failure()
run: |
echo "=========================================="
echo "DISTCHECK FAILURE SUMMARY"
echo "=========================================="

# Show any test-suite.log from distcheck
find . -name "test-suite.log" -type f | while read logfile; do
echo "=== $logfile ==="
head -20 "$logfile"
echo ""
if grep -q "^FAIL\|^ERROR" "$logfile"; then
echo "Failed tests in $logfile:"
grep "^FAIL\|^ERROR" "$logfile"
echo ""
fi
done

echo "Full details available in uploaded artifacts"
Loading