From: Junio C Hamano <gitster@pobox.com>
To: Eugenio Bargiacchi <svalorzen@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Better visual separation of hunks in `git add -p`
Date: Thu, 28 Mar 2024 09:50:49 -0700 [thread overview]
Message-ID: <xmqqo7ayuwpi.fsf@gitster.g> (raw)
In-Reply-To: <CAHfn=+snXChcPFiEgxvK=XFCq2uVMKQTyfrN9RNfAod18d0V=Q@mail.gmail.com> (Eugenio Bargiacchi's message of "Thu, 28 Mar 2024 14:36:11 +0100")
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.
next prev parent reply other threads:[~2024-03-28 16:50 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 [this message]
2024-03-28 17:10 ` Eugenio Bargiacchi
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo7ayuwpi.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=svalorzen@gmail.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.
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).