git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eugenio Bargiacchi <svalorzen@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Better visual separation of hunks in `git add -p`
Date: Thu, 28 Mar 2024 18:10:03 +0100	[thread overview]
Message-ID: <CAHfn=+sJotET-x7wZWZH0p4znR=o909qyV6wSDq_D0+VivT67w@mail.gmail.com> (raw)
In-Reply-To: <xmqqo7ayuwpi.fsf@gitster.g>

Thank you for the suggestion, it already helps a bit.

The problem only using indentations as a visual separator, for me, is
that if the code snipped already has indentations, then the ones added
by 'git add' do not really stand up, and instead become part of a very
long uninterrupted stream of text. In addition to this, given that the
snippet is colored, the result is a very bright and flashy wall of
text that can be a bit much to sift through (were it all the same
color it would be worse though). Being able to break up the hunks
visually with some whitespace would really go a long way.

In any case, for now I'll try to pick up the most obnoxious colors for
the prompt that I can :) Hopefully in the future this will be an
available option for difficult people like me.

On Thu, 28 Mar 2024 at 17:50, Junio C Hamano <gitster@pobox.com> wrote:
>
> Eugenio Bargiacchi <svalorzen@gmail.com> writes:
>
> > I'm looking for a way to print some sort of separator between hunks
> > when running `git add -p`, as I have a bit of trouble detecting when
> > the previous hunk begins and the current one starts. Being able to
> > print an empty line or a couple lines filled with "=======" would
> > really help me out.
>
> Hmph, my hope when I designed that particular UI was that the
> command prompt for the previous interaction followed by the hunk
> header of the current hunk would give us clear enough separation.
>
> For example, after answering "n" to the prompt for the previous
> hunk, we'd see
>
>     ...
>     +   (merge bff85a338c bl/doc-key-val-sep-fix later to maint).
>     +
>       * Other code cleanup, docfix, build fix, etc.
>         (merge f0e578c69c rs/use-xstrncmpz later to maint).
>         (merge 83e6eb7d7a ba/credential-test-clean-fix later to maint).
>     (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? n
>     @@ -233,3 +245,6 @@ Fixes since v2.44
>         (merge 781fb7b4c2 as/option-names-in-messages later to maint).
>         (merge 51d41dc243 jk/doc-remote-helpers-markup-fix later to maint).
>         (merge e1aaf309db pb/ci-win-artifact-names-fix later to maint).
>     +   (merge ad538c61da jc/index-pack-fsck-levels later to maint).
>     +   (merge 67471bc704 ja/doc-formatting-fix later to maint).
>     ...
>     (2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,?]?
>
> The '@' (the first character of the hunk header line for the current
> hunk) and "(1/2" are surrounded by lines that begin with a space,
> and the hope was that it was sufficient "separator" already.
>
> These days (long after I stopped mucking with the interactive add
> code actively), the prompt line is painted in prompt_color (you can
> tweak it with the color.interactive.prompt configuration variable,
> it defaults to BOLD BLUE) while the first part of the hunk header
> line is painted in the fraginfo color (default CYAN), which should
> give you even more visual distinction.
>
> Perhaps
>
>     [color "interactive"]
>         prompt = bold red reverse
>
> would be sufficient?  I dunno.
>


  reply	other threads:[~2024-03-28 17:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 13:36 Better visual separation of hunks in `git add -p` Eugenio Bargiacchi
2024-03-28 16:50 ` Junio C Hamano
2024-03-28 17:10   ` Eugenio Bargiacchi [this message]
2024-03-28 18:14   ` Dragan Simic
2024-03-28 18:21     ` Junio C Hamano
2024-03-28 18:29       ` Dragan Simic
2024-03-28 19:01         ` Eugenio Bargiacchi
2024-03-28 19:04           ` Dragan Simic
2024-03-28 19:08             ` Eugenio Bargiacchi
2024-03-28 19:16               ` Dragan Simic
2024-03-28 20:43                 ` Junio C Hamano
2024-03-28 21:19                   ` Dragan Simic
2024-03-28 21:43                     ` Eugenio Bargiacchi
2024-03-28 21:49                       ` Dragan Simic

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='CAHfn=+sJotET-x7wZWZH0p4znR=o909qyV6wSDq_D0+VivT67w@mail.gmail.com' \
    --to=svalorzen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).