{"thread":{"id":"14251","subject":"Re: [PATCH] git-add--interactive: manual hunk editing mode","startedAt":"2008-07-02T09:03:53Z","lastAt":"2008-07-02T09:03:53Z","messageCount":1,"participants":["Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"81957","messageId":"200807021103.56570.trast@student.ethz.ch","threadId":"14251","inReplyTo":null,"subject":"Re: [PATCH] git-add--interactive: manual hunk editing mode","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-07-02T09:03:53Z","receivedAt":"2008-07-02T09:03:53Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"[Wrong button at first, sorry for the double mail Junio]\n\nJunio C Hamano wrote:\n> \n> If you change '-' to ' ', or remove '+', then you are temporarily\n> reverting the change you have made since HEAD to your working tree copy.\n> If you do not change anything, you are taking something that was in your\n> working tree copy.  Both are simpler and easier to explain operations.\n[...]\n> Once you start to [support truly free editing of the hunk],\n> you would need to worry about the case where\n> the hunk extended to include later lines overlaps with the hunk after the\n> one we are currently looking at, and run coalesce_overlapping_hunks to\n> concatenate them into a larger single hunk.  But to be able to do that,\n> you would need to keep track of the number of lines in a hunk yourself\n> anyway, which would mean that you cannot rely on --recount anymore.  The\n> extension recently made to \"git apply\" becomes redundant and unused code.\n> \n> In short, declaring that you are supporting the use to change ' ' to '-'\n> means you are opening a whole can of worms, and I asked the question\n> because I did not know if you are really prepared to deal with it.\n\nThis issue is why I feed the entire patch (not just the edited hunk)\nto git-apply --check.  That's really the only promise this feature\nmakes: if you hand it a patch that does not apply, it will refuse.  If\nyou do hand it a hunk where you manually inserted some extra context,\nthen added some extra changes that weren't in the original hunk, well,\ntough.  (You asked for a gun _and_ loaded it _and_ pointed it at your\nfoot!)\n\nThat being said, we could of course add a notice of the form\n\n  # Do not edit in any other ways unless you know what you are doing.\n\nif that constitutes appropriate \"trigger safety\".\n\n- Thomas\n\n-- \nThomas Rast\ntrast@student.ethz.ch\n\n\n\n\n"}]}