git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gavrilov <angavrilov@gmail.com>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Johannes Sixt <j.sixt@viscovery.net>
Subject: [PATCH (GIT-GUI FIX)] git-gui: Restore ability to Stage Working Copy for conflicts.
Date: Mon, 8 Sep 2008 20:37:11 +0400	[thread overview]
Message-ID: <200809082037.12173.angavrilov@gmail.com> (raw)

Tools like rerere leave files marked as conflicts in the index,
while actually resolving them in the working copy. Also, some
people like to use an external editor to resolve conflicts.

This patch restores functionality previously removed in
commit 617ceee653 by adding a new context menu item.
It still ensures that the user does not stage conflicting files
accidentally by clicking on the icon instead of the name.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
 git-gui.sh        |    5 +++++
 lib/mergetool.tcl |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index d227eca..a732ef1 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2984,6 +2984,11 @@ $ctxmmg add command \
 	-command {merge_resolve_one 1}
 lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
 $ctxmmg add separator
+$ctxmmg add command \
+	-label [mc "Stage Working Copy"] \
+	-command {merge_resolve_one 0}
+lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
+$ctxmmg add separator
 create_common_diff_popup $ctxmmg
 
 proc popup_diff_menu {ctxm ctxmmg x y X Y} {
diff --git a/lib/mergetool.tcl b/lib/mergetool.tcl
index 79c58bc..dd2315b 100644
--- a/lib/mergetool.tcl
+++ b/lib/mergetool.tcl
@@ -5,6 +5,12 @@ proc merge_resolve_one {stage} {
 	global current_diff_path
 
 	switch -- $stage {
+		0 {	# Stage without confirmation, to minimize
+			# disruption of the rerere workflow
+			merge_add_resolution $current_diff_path
+			return
+		}
+
 		1 { set target [mc "the base version"] }
 		2 { set target [mc "this branch"] }
 		3 { set target [mc "the other branch"] }
-- 
1.6.0.20.g6148bc

             reply	other threads:[~2008-09-08 16:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 16:37 Alexander Gavrilov [this message]
2008-09-09  6:18 ` [PATCH (GIT-GUI FIX)] git-gui: Restore ability to Stage Working Copy for conflicts Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200809082037.12173.angavrilov@gmail.com \
    --to=angavrilov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).