git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org
Subject: Re: Antw: [EXT] Re: git add --interactive patch improvement for split hunks
Date: Tue, 29 Jun 2021 22:16:26 -0400	[thread overview]
Message-ID: <YNvT+tUlW98dQY3B@coredump.intra.peff.net> (raw)
In-Reply-To: <87eecmgrnx.fsf@evledraar.gmail.com>

On Mon, Jun 28, 2021 at 01:20:46PM +0200, Ævar Arnfjörð Bjarmason wrote:

> > There always was a related bug (IMHO) that showed the context of the
> > previous function even though the actual change was within a new
> > function (that starts within the context lines). So if that bug were
> > fixed, my guess is that the other would be as well.
> > However I don't know how easy or hard the fix will be.
> > Maybe the "definition" of function context is just different; I don't really know.
> 
> Does that bug perhaps have anything to do with:
> https://lore.kernel.org/git/20210215155020.2804-2-avarab@gmail.com/

I think it's similar. The issue is that we search backwards for a
funcname match from the top of the hunk, _not_ from the first changed
line. IIRC, that has been discussed before and considered "not a bug",
but I could be mis-remembering (and it's a tricky thing to search in the
archive for[0]).

The problem with split hunks is different, though; we do not search for
a funcname line at all on the second half of the hunk.

-Peff

[0] I did come up with:

      https://lore.kernel.org/git/1399824596-4670-1-git-send-email-avarab@gmail.com/

    which has discussion between you and me on this very same splitting
    topic back in 2014! Double-curious, your patch there implements the
    same "keep the hunk header on split" we've been discussing here, and
    we were all positive on it. Yet it doesn't seem to have ever gotten
    applied.

    It looks like Junio carried it in "What's Cooking" for almost a
    year, marked as "waiting for re-roll" to handle the squash, but then
    eventually discarded it as stale. :(

  reply	other threads:[~2021-06-30  2:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 10:35 git add --interactive patch improvement for split hunks Ulrich Windl
2021-06-24 15:41 ` Jeff King
2021-06-28 10:10   ` Antw: [EXT] " Ulrich Windl
2021-06-28 11:20     ` Ævar Arnfjörð Bjarmason
2021-06-30  2:16       ` Jeff King [this message]
2021-06-30  6:09         ` Junio C Hamano
2021-06-30  7:31           ` Jeff King
2021-06-30  8:27             ` Ævar Arnfjörð Bjarmason
2021-06-30 17:06               ` Jeff King

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=YNvT+tUlW98dQY3B@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Ulrich.Windl@rz.uni-regensburg.de \
    --cc=avarab@gmail.com \
    --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.
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).