RFE: merge driver without overwrite
- From
- H. Peter Anvin <hpa@zytor.com>
- Date
- Dec 27, 2018, 20:21 UTC
- Message-ID
- <c3ad1c9b-86a6-2c51-8147-991ecbac1885@zytor.com>
The current definition for merge drivers require the output file %A to be overwritten. When using a pipeline of Unix commands, this often results in %A being truncated too early, requiring the user to add a temporary file managed explicitly.
It would be far preferable if git could manage this; perhaps an %N marker for a temporary filename, which, if given, is treated as the output; notionally:
if [ $? -eq 0 -a -f %N ]; then mv -f %N %A; else rm -f %N; fi
-hpa