diff --git a/scripts/resolve.rcsh b/scripts/resolve.rcsh new file mode 100755 index 0000000..f1bf586 --- /dev/null +++ b/scripts/resolve.rcsh @@ -0,0 +1,31 @@ +#!/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 + } +} +