Fix post-merge hook to show actual error messages

Previously the hook redirected stderr to /dev/null, hiding useful error
messages like 'Git conflict markers detected'. Users only saw a generic
warning with no indication of the root cause.

Now captures and displays the actual error output, making it immediately
clear what went wrong (e.g., merge conflicts in JSONL).

Fixes bd-nszi

Amp-Thread-ID: https://ampcode.com/threads/T-6231e968-2c06-44ad-855d-bb5fafe452f6
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-08 02:45:51 -08:00
parent 27fd6e4287
commit abb1d1c714
3 changed files with 362 additions and 243 deletions

View File

@@ -33,9 +33,12 @@ fi
# Run bd sync --import-only to import the updated JSONL
# This is more robust than direct import as it handles all edge cases
if ! bd sync --import-only >/dev/null 2>&1; then
# Capture both stdout and stderr to show user what went wrong
if ! output=$(bd sync --import-only 2>&1); then
echo "Warning: Failed to sync bd changes after merge" >&2
echo "Run 'bd sync --import-only' manually" >&2
echo "$output" >&2
echo "" >&2
echo "Run 'bd sync --import-only' manually to resolve" >&2
# Don't fail the merge, just warn
fi