Re: Handling merge conflicts a bit more gracefully..
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jun 8, 2005, 23:35 UTC
- Message-ID
- <Pine.LNX.4.58.0506081629370.2286@ppc970.osdl.org>
- In-Reply-To
- <7vis0o30sc.fsf@assigned-by-dhcp.cox.net>
On Wed, 8 Jun 2005, Junio C Hamano wrote:
> # Deleted in both. > > Making sure that the path does not exist in the work tree with > test -f "$4" would be more sensible, before running --remove.
Yeah, my (broken) thinking was that since it wasn't in both, it wasn't in the working directory either, but you're right, that's just crazy talk. There could be a stale file there.
Made it do a
rm -f -- "$4" || exit 1
instead (and changed the other one to do the "|| exit 1" too, since you're also obviously right on the directory issue).
Show 5 quoted lines
> # Modified in both, but differently. > + merge -p "$src1" "$orig" "$src2" > "$4" > > Again, make sure "$4" is not a directory before redirecting into > it from merge, so that you can tell merge failures from it?
Hmm.. What's the cleanest way to check for redirection errors, but still be able to distinguish those cleanly from "merge" itself returning an error?
Linus