From: Jon Seymour <jon.seymour@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: spearce@spearce.org
Subject: [PATCH v2 2/2] git-gui: change to display the diff with the HEAD in the case of conflicts.
Date: Tue, 30 Mar 2010 10:01:21 +1100 [thread overview]
Message-ID: <2cfc40321003291601v424caa0dxa5554768230297ec@mail.gmail.com> (raw)
The rationale for this change is that the previous behaviour did not allow
the user to make an informed decision about the likely consequences
of "Use Local Version" or "Stage to commit" for conflicted files. The
reason for this is that in the conflicted case, successfully staged
remote hunks are effectively invisible to user (via the git-gui interface)
and hence cannot inform the user's decision making process.
For example, previously use of "Use Local Version" would silently discard
from the index, and the working tree any successfully merged remote hunks.
Since these hunks had never been displayed to the user, this
loss would be unnoticed and unexpected.
In the case of "Stage to commit", the successfully merged remote
hunks would be preserved in the index and the working tree but the fact
that there are successfully merged remote hunks would not be not
visible until after the "Stage to commit" action has been taken.
If the user did not check diff _after_ taking the action, the user
may have unwittingly commit changes from a remote hunk
that she was not aware of.
With this change, in the case of conflicted paths only, git-gui displays
what the index would contain if the current working tree copy was
staged to the index as is. If there are successfully merged hunks
from the remote branch in the index, then these will be visible in diff,
thus making the potential consequences of both "Use Local Version"
and "Stage to commit" directly visible prior to the user's action.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-gui/lib/diff.tcl | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index e7b1986..a017fba 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -300,7 +300,11 @@ proc start_show_diff {cont_info {add_opts {}}} {
}
if {$w eq $ui_index} {
lappend cmd [PARENT]
- }
+ } else {
+ if {$is_unmerged} {
+ lappend cmd "HEAD"
+ }
+ }
if {$add_opts ne {}} {
eval lappend cmd $add_opts
} else {
--
1.6.6.1
reply other threads:[~2010-03-29 23:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=2cfc40321003291601v424caa0dxa5554768230297ec@mail.gmail.com \
--to=jon.seymour@gmail.com \
--cc=git@vger.kernel.org \
--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).