"""
import argparse
+import os
+from pathlib import Path
import subprocess
import sys
from typing import List, Tuple, Union
if pmin or pmax:
last_target = f'{rbranch}~{first_fail}'
+ result = git(['log', '-1', '--format=%s', last_target])
+ subject = result.stdout.strip()
if leave_rebase:
print('Restarting', last_target)
result = git(['rebase', last_target], check=False)
print(result.stdout.strip())
- else:
- print('Found first failure', last_target)
+ print(f'* Found first failure {last_target}: {subject}')
else:
print('All caught up!')
parser = get_parser()
opts = parser.parse_args(argv)
- lbranch = get_local_branch()
+ try:
+ lbranch = get_local_branch()
+ except subprocess.CalledProcessError as e:
+ sys.exit(f'{os.path.basename(sys.argv[0])}: {Path.cwd()}:\n{e}\n{e.stderr.strip()}')
print(f'Local branch resolved to "{lbranch}".')
if not lbranch:
print('Unable to resolve local branch', file=sys.stderr)