Merge pull request #26 from mikofski/devel
[msysgit/kirr.git] / bin / edit-conflicts.sh
blobd9e46ec5bf8c43f9a1b3d33cda5f2de61c77c468
1 #!/bin/sh
3 # Copyright (c) 2007 Johannes E. Schindelin
5 # Cleanup unreachable files and optimize the repository.
7 USAGE='my-edit-conflicts'
8 SUBDIRECTORY_OK=Yes
9 . "$(git --exec-path)"/git-sh-setup
10 cd_to_toplevel
12 test -z "$(git ls-files --unmerged)" && echo "Nothing to do" && exit
14 git ls-files --unmerged | cut -b51- | grep ' ' >/dev/null &&
15 die "filenames contain spaces"
17 opt=
18 test vi = "${VISUAL:-${EDITOR:-vi}}" && opt="+/<<<<<<<"
19 "${VISUAL:-${EDITOR:-vi}}" $opt $(git ls-files --unmerged | cut -b51- | uniq)
20 git add $(git ls-files --unmerged | cut -b51- | uniq)