From: Jeff Epler <jepler@unpythonic.net>
To: git@vger.kernel.org
Cc: Jeff Epler <jepler@unpythonic.net>
Subject: [RFC PATCH 1/2] Fix applying a line when all following lines are deletions
Date: Wed, 21 Oct 2009 16:20:22 -0500 [thread overview]
Message-ID: <1256160023-29629-2-git-send-email-jepler@unpythonic.net> (raw)
In-Reply-To: <1256160023-29629-1-git-send-email-jepler@unpythonic.net>
If a diff looked like
@@
context
-del1
-del2
and you wanted to stage the deletion 'del1', the generated patch
wouldn't apply because it was missing the line 'del2' converted to
context, but this line was counted in the @@-line
---
lib/diff.tcl | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/diff.tcl b/lib/diff.tcl
index bd5d189..066755b 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -664,6 +664,7 @@ proc apply_line {x y} {
}
set i_l $next_l
}
+ set patch "$patch$pre_context"
set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch"
if {[catch {
--
1.6.5.rc1.49.ge970
next prev parent reply other threads:[~2009-10-21 21:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 21:20 [RFC PATCH v2 0/2] git-gui: (un)stage a range of changes at once Jeff Epler
2009-10-21 21:20 ` Jeff Epler [this message]
2009-12-05 21:32 ` [RFC PATCH 1/2] Fix applying a line when all following lines are deletions Shawn O. Pearce
2009-10-21 21:20 ` [RFC PATCH 2/2] Make it possible to apply a range of changes at once Jeff Epler
2009-10-26 19:39 ` [RFC PATCH v2 0/2] git-gui: (un)stage " Jeff Epler
2009-12-05 21:36 ` Shawn O. Pearce
2009-12-07 12:54 ` Heiko Voigt
2009-12-08 0:38 ` Jeff Epler
2009-12-11 18:57 ` Heiko Voigt
2009-10-29 7:34 ` Peter Baumann
2009-12-04 22:07 ` Heiko Voigt
2009-12-05 21:19 ` 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=1256160023-29629-2-git-send-email-jepler@unpythonic.net \
--to=jepler@unpythonic.net \
--cc=git@vger.kernel.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).