Configuration for my NixOS based systems and Home Manager
1#!/usr/bin/env rc
2
3flag e +
4
5gitroot=`{git rev-parse --show-toplevel}
6
7if(~ $1 -x --debug) {
8 flag x +
9 shift
10}
11
12if(~ $* ()) {
13 conflicted=`{git ls-files -u $gitroot | cut -f2 | uniq}
14} else {
15 conflicted=$*
16}
17
18echo Conflicted files: $conflicted >[1=2]
19
20for (file in $conflicted) {
21 prompt=(Do you want to add $file to the index? (y/n): ' ')
22 echo Editing $file
23 # Edit the file
24 $EDITOR $file
25 # Prompt for if we want to add it
26 read -p $"prompt response; #"
27 if (~ $response y Y) {
28 git add $file
29 }
30}
31