From: Jens Lehmann <Jens.Lehmann@web.de>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: [PATCH] git-gui: fix diff for partially staged submodule changes
Date: Wed, 26 Aug 2009 22:25:15 +0200 [thread overview]
Message-ID: <4A959A2B.9080505@web.de> (raw)
When a submodule commit had already been staged and another commit had
been checked out inside the submodule, the diff always displayed the
submodule commit log messages between the last supermodule commit and
the working tree, totally ignoring the commit in the index.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
This fixes a regression introduced by this recent patch of mine:
"git-gui: display summary when showing diff of a submodule"
Sorry for the inconvenience.
git-gui/lib/diff.tcl | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index ae1ea3a..d593323 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -298,7 +298,12 @@ proc start_show_diff {cont_info {add_opts {}}} {
if {[string match {160000 *} [lindex $s 2]]
|| [string match {160000 *} [lindex $s 3]]} {
- set cmd {submodule summary -- $current_diff_path}
+ set is_submodule_diff 1
+ if {$w eq $ui_index} {
+ set cmd {submodule summary --cached -- $current_diff_path}
+ } else {
+ set cmd {submodule summary --files -- $current_diff_path}
+ }
}
if {[catch {set fd [eval git_read --nice $cmd]} err]} {
@@ -343,9 +348,6 @@ proc read_diff {fd cont_info} {
}
set ::current_diff_inheader 0
- if {[regexp {^\* } $line]} {
- set is_submodule_diff 1
- }
# -- Automatically detect if this is a 3 way diff.
#
if {[string match {@@@ *} $line]} {set is_3way_diff 1}
--
1.6.4.184.ge7b6.dirty
reply other threads:[~2009-08-26 20:25 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=4A959A2B.9080505@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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).