git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Alexander Gladysh <agladysh@gmail.com>,
	git@vger.kernel.org, Pat Thoyts <patthoyts@users.sourceforge.net>
Subject: Re: Git Gui does not want to work on chunk level
Date: Tue, 30 Nov 2010 23:20:03 +0100	[thread overview]
Message-ID: <AANLkTikd84--37+vcoHifqFeUGznEQ9YXDaY3a3zOekn@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimz17vodjS7K_ts2pcoZHTo2eb9=FaWwEyhihsa@mail.gmail.com>

On Tue, Nov 30, 2010 at 22:19, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Mon, Sep 15, 2008 at 09:08, Johannes Sixt <j.sixt@viscovery.net> wrote:
>>  new file mode 100644
>>  --- /dev/null
>>  +++ b/foo
>>  @@ -0,0 +1 @@
>>  +foo
>
> I just noticed the same, and ask me why this report wasn't honored.
>
> Also git may spill out 2 diffs for type changes (file to symlink, for
> example). In this case the we should probably disable any hunk- or
> line-level (un)staging.

Here is a proposal which fixes this case. Not tested on the OPs report.

--8<--
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 8fea947..b3901c3 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -398,7 +398,6 @@ proc read_diff {fd conflict_size cont_info} {
 		if {$line eq {deleted file mode 120000}} {
 			set line "deleted symlink"
 		}
-		set ::current_diff_inheader 0

 		# -- Automatically detect if this is a 3 way diff.
 		#
@@ -414,6 +413,7 @@ proc read_diff {fd conflict_size cont_info} {
 			|| [regexp {^\* Unmerged path } $line]} {
 			set tags {}
 		} elseif {$is_3way_diff} {
+			set ::current_diff_inheader 0
 			set op [string range $line 0 1]
 			switch -- $op {
 			{  } {set tags {}}
@@ -440,6 +440,7 @@ proc read_diff {fd conflict_size cont_info} {
 			}
 			}
 		} elseif {$is_submodule_diff} {
+			set ::current_diff_inheader 0
 			if {$line == ""} continue
 			if {[regexp {^Submodule } $line]} {
 				set tags d_@
@@ -459,6 +460,7 @@ proc read_diff {fd conflict_size cont_info} {
 				}
 			}
 		} else {
+			set ::current_diff_inheader 0
 			set op [string index $line 0]
 			switch -- $op {
 			{ } {set tags {}}

  reply	other threads:[~2010-11-30 22:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c6c947f60808270216k2feb8f9ar765cdee1fc3910ee@mail.gmail.com>
     [not found] ` <c6c947f60808270216k2feb8f9ar765cdee1fc3910ee-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-03 19:23   ` Git Gui does not want to work on chunk level Alexander Gladysh
2008-09-03 23:08     ` Shawn O. Pearce
2008-09-04  9:20       ` Alexander Gladysh
2008-09-04 14:37         ` Shawn O. Pearce
     [not found]           ` <20080904143723.GB23708-o8xcbExO1WpAfugRpC6u6w@public.gmane.org>
2008-09-04 14:54             ` Alexander Gladysh
2008-09-05  4:53               ` Shawn O. Pearce
2008-09-05  5:18                 ` Junio C Hamano
2008-09-05  5:20                   ` Shawn O. Pearce
     [not found]                 ` <20080905045327.GA31166-o8xcbExO1WpAfugRpC6u6w@public.gmane.org>
2008-09-05 19:27                   ` Alexander Gladysh
2008-09-15  7:08                 ` Johannes Sixt
2010-11-30 21:19                   ` Bert Wesarg
2010-11-30 22:20                     ` Bert Wesarg [this message]
2010-12-06 21:30                       ` Bert Wesarg
2008-09-15 14:21                 ` Alexander Gladysh
     [not found]                   ` <c6c947f60809150721m1ec11f10xc68ce39559398659-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-15 14:24                     ` Shawn O. Pearce

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=AANLkTikd84--37+vcoHifqFeUGznEQ9YXDaY3a3zOekn@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=agladysh@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=patthoyts@users.sourceforge.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).