#!/usr/bin/env rc flag e + gitroot=`{git rev-parse --show-toplevel} if(~ $1 -x --debug) { flag x + shift } if(~ $* ()) { conflicted=`{git ls-files -u $gitroot | cut -f2 | uniq} } else { conflicted=$* } echo Conflicted files: $conflicted >[1=2] for (file in $conflicted) { prompt=(Do you want to add $file to the index? (y/n): ' ') echo Editing $file # Edit the file $EDITOR $file # Prompt for if we want to add it read -p $"prompt response; #" if (~ $response y Y) { git add $file } }