Alexander Gladysh <agladysh@xxxxxxxxx> wrote: > On Wed, Aug 27, 2008 at 1:16 PM, Alexander Gladysh <agladysh@xxxxxxxxx> wrote: > > $ git --version > > git version 1.6.0.GIT > > > > $ git gui --version > > git-gui version 0.11.GITGUI > > > > I like 'stage hunk for commit' feature in Git Gui, but often it gives > > me an error message box: > > > > fatal: git-apply: bad git-diff - inconsistent old filename on line 4 ... > Does anyone else encounter this kind of error? Any debugging advice? > Perhaps I can instrument git gui with logging somewhere (dump diffs > for example). (I have no experience with TCL though.) I've never seen that before, but its clearly dumping a bad diff into git-apply. Open up lib/diff.tcl and find "proc apply_hunk". Inside of the catch maybe insert a puts to see the diff, e.g.: diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl index 52b79e4..4acaccf 100644 --- a/git-gui/lib/diff.tcl +++ b/git-gui/lib/diff.tcl @@ -341,6 +341,8 @@ proc apply_hunk {x y} { fconfigure $p -translation binary -encoding binary puts -nonewline $p $current_diff_header puts -nonewline $p [$ui_diff get $s_lno $e_lno] +puts -nonewline stdout $current_diff_header +puts -nonewline stdout [$ui_diff get $s_lno $e_lno] close $p} err]} { error_popup [append $failed_msg "\n\n$err"] unlock_index Then if you can scrub the context and +/- lines for a bad diff and send us at least the headers, or tell us how they are malformed, it would help to debug it. -- Shawn. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html