Conflict editing
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 4, 2007, 12:43 UTC
- Message-ID
- <Pine.LNX.4.63.0703041339350.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Hi,
I often end up with conflicts, and I just want to edit the conflicting files, one after another. To make this easier, I wrote a script (yes, no builtin) to start the editor with the files having conflicts.
Of course, this script is dumb and has no way to edit files whose names contain spaces, it will choke on conflicting symlinks and it does not update the index after editing the files (to avoid erroneous updating). As usual, it did not really receive more testing than absolutely necessary.
Ciao, Dscho
-- snipsnap -- #!/bin/sh # # Copyright (c) 2006, Shawn O. Pearce # # Cleanup unreachable files and optimize the repository.
USAGE='' SUBDIRECTORY_OK=Yes . git-sh-setup cd_to_toplevel
test -z "$(git ls-files --unmerged)" && echo "Nothing to do" && exit
git ls-files --unmerged | cut -b51- | grep ' ' >/dev/null && die "filenames contain spaces"
"${VISUAL:-${EDITOR:-vi}}" $(git ls-files --unmerged | cut -b51- | uniq)