Re: git-rerere observations and feature suggestions

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Junio C Hamano <gitster@...>, <git@...>, Chris Mason <chris.mason@...>, Thomas Gleixner <tglx@...>
Date: Monday, June 23, 2008 - 10:19 am

On Mon, 2008-06-23 at 11:49 +0200, Ingo Molnar wrote:

This is what I run with.

I added the cp to the 3-way merge tools because I think its stupid to
see the messed up merge markers instead of the original file.

The rej target basically takes the local version and takes the diff
between base and remote and applies that as a patch, upon failure it
invokes rej to fix up the mess.

--- /usr/bin/git-mergetool	2008-04-08 19:01:37.000000000 +0200
+++ git-mergetool	2008-06-02 19:00:55.000000000 +0200
@@ -214,12 +214,14 @@ merge_file () {
 	    ;;
 	meld|vimdiff)
 	    touch "$BACKUP"
+	    cp -- "$BASE" "$path"
 	    "$merge_tool_path" -- "$LOCAL" "$path" "$REMOTE"
 	    check_unchanged
 	    save_backup
 	    ;;
 	gvimdiff)
 		touch "$BACKUP"
+		cp -- "$BASE" "$path"
 		"$merge_tool_path" -f -- "$LOCAL" "$path" "$REMOTE"
 		check_unchanged
 		save_backup
@@ -271,6 +273,13 @@ merge_file () {
 	    status=$?
 	    save_backup
 	    ;;
+        rej)
+	    touch "$BACKUP"
+	    cp -- "$LOCAL" "$path"
+	    diff -up "$BASE" "$REMOTE" | patch "$path" || rej "$path"
+	    check_unchanged
+	    save_backup
+	    ;;
     esac
     if test "$status" -ne 0; then
 	echo "merge of $path failed" 1>&2
@@ -311,7 +320,7 @@ done
 
 valid_tool() {
 	case "$1" in
-		kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge)
+		kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge | rej)
 			;; # happy
 		*)
 			return 1


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 16, 7:01 am)
Re: git-rerere observations and feature suggestions, Johannes Schindelin, (Tue Jun 17, 6:24 am)
Re: git-rerere observations and feature suggestions, Jakub Narebski, (Mon Jun 16, 4:11 pm)
Re: git-rerere observations and feature suggestions, Junio C Hamano, (Mon Jun 16, 2:46 pm)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 23, 5:49 am)
Re: git-rerere observations and feature suggestions, Jeff King, (Mon Jun 23, 11:12 am)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 23, 11:22 am)
Re: git-rerere observations and feature suggestions, Peter Zijlstra, (Mon Jun 23, 10:19 am)
Re: git-rerere observations and feature suggestions, Peter Zijlstra, (Mon Jun 23, 10:26 am)
Re: git-rerere observations and feature suggestions, Junio C Hamano, (Mon Jun 16, 3:10 pm)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 16, 3:44 pm)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 16, 3:09 pm)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Wed Jun 18, 6:57 am)
Re: git-rerere observations and feature suggestions, Jakub Narebski, (Wed Jun 18, 6:01 pm)
Re: git-rerere observations and feature suggestions, Miklos Vajna, (Wed Jun 18, 6:38 pm)
Re: git-rerere observations and feature suggestions, Junio C Hamano, (Thu Jun 19, 3:30 am)
Re: git-rerere observations and feature suggestions, Miklos Vajna, (Thu Jun 19, 4:33 am)
Re: git-rerere observations and feature suggestions, Miklos Vajna, (Thu Jun 19, 6:06 am)
Re: git-rerere observations and feature suggestions, Miklos Vajna, (Thu Jun 19, 3:29 am)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Wed Jun 18, 7:36 am)
Re: git-rerere observations and feature suggestions, Miklos Vajna, (Wed Jun 18, 7:29 am)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Wed Jun 18, 2:43 pm)
Re: git-rerere observations and feature suggestions, Miklos Vajna, (Wed Jun 18, 3:53 pm)
Re: git-rerere observations and feature suggestions, Junio C Hamano, (Mon Jun 16, 4:50 pm)
Re: git-rerere observations and feature suggestions, Theodore Tso, (Mon Jun 16, 7:27 am)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 16, 3:52 pm)
Re: git-rerere observations and feature suggestions, Junio C Hamano, (Mon Jun 16, 4:25 pm)
Re: git-rerere observations and feature suggestions, Ingo Molnar, (Mon Jun 16, 4:46 pm)
Re: git-rerere observations and feature suggestions, Junio C Hamano, (Mon Jun 16, 5:37 pm)
Re: git-rerere observations and feature suggestions, Mike Hommey, (Mon Jun 16, 7:09 am)
Re: git-rerere observations and feature suggestions, Pierre Habouzit, (Mon Jun 16, 11:48 am)
Re: git-rerere observations and feature suggestions, Pierre Habouzit, (Mon Jun 16, 11:57 am)
Re: git-rerere observations and feature suggestions, Sverre Rabbelier, (Mon Jun 16, 12:18 pm)