git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] git-add--interactive: manual hunk editing mode
Date: Wed, 2 Jul 2008 11:03:53 +0200	[thread overview]
Message-ID: <200807021103.56570.trast@student.ethz.ch> (raw)

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

[Wrong button at first, sorry for the double mail Junio]

Junio C Hamano wrote:
> 
> If you change '-' to ' ', or remove '+', then you are temporarily
> reverting the change you have made since HEAD to your working tree copy.
> If you do not change anything, you are taking something that was in your
> working tree copy.  Both are simpler and easier to explain operations.
[...]
> Once you start to [support truly free editing of the hunk],
> you would need to worry about the case where
> the hunk extended to include later lines overlaps with the hunk after the
> one we are currently looking at, and run coalesce_overlapping_hunks to
> concatenate them into a larger single hunk.  But to be able to do that,
> you would need to keep track of the number of lines in a hunk yourself
> anyway, which would mean that you cannot rely on --recount anymore.  The
> extension recently made to "git apply" becomes redundant and unused code.
> 
> In short, declaring that you are supporting the use to change ' ' to '-'
> means you are opening a whole can of worms, and I asked the question
> because I did not know if you are really prepared to deal with it.

This issue is why I feed the entire patch (not just the edited hunk)
to git-apply --check.  That's really the only promise this feature
makes: if you hand it a patch that does not apply, it will refuse.  If
you do hand it a hunk where you manually inserted some extra context,
then added some extra changes that weren't in the original hunk, well,
tough.  (You asked for a gun _and_ loaded it _and_ pointed it at your
foot!)

That being said, we could of course add a notice of the form

  # Do not edit in any other ways unless you know what you are doing.

if that constitutes appropriate "trigger safety".

- Thomas

-- 
Thomas Rast
trast@student.ethz.ch





[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

             reply	other threads:[~2008-07-02  9:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02  9:03 Thomas Rast [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-01 10:11 What's cooking in git.git (topics) Jeff King
2008-07-01 11:44 ` [PATCH] git-add--interactive: manual hunk editing mode Thomas Rast
2008-07-01 16:48   ` Johannes Schindelin
2008-07-01 23:54   ` Junio C Hamano
2008-07-02  5:39   ` Junio C Hamano
2008-07-02  7:00     ` Thomas Rast
2008-07-02  8:38       ` Junio C Hamano
2008-07-02  8:02     ` Jeff King
2008-07-02  8:08       ` Junio C Hamano
2008-07-02  8:32         ` Jeff King
2008-07-02 13:13           ` Johannes Schindelin
2008-07-02 18:27             ` Junio C Hamano
2008-05-23 20:21 Thomas Rast
2008-05-24  1:24 ` Ping Yin
2008-05-29 15:37 ` Thomas Rast
2008-05-29 16:12   ` Johannes Schindelin
2008-05-29 19:10     ` Thomas Rast
2008-05-29 19:16       ` Thomas Rast
2008-05-29 18:58   ` Jeff King
2008-05-30  9:49     ` Johannes Schindelin
2008-05-30 10:46       ` Jakub Narebski
2008-05-30 12:21     ` Thomas Rast
2008-05-30 21:35       ` Junio C Hamano
2008-06-05  9:02     ` Thomas Rast

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=200807021103.56570.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).