git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Better visual separation of hunks in `git add -p`

From
EBEugenio Bargiacchi <svalorzen@gmail.com>
Date
Mar 28, 2024, 21:43 UTC
Message-ID
<CAHfn=+uXhAW+7YG6R6BAeTOcWdrGQjUwGYCT6QJ3u9d9TwaySg@mail.gmail.com>
In-Reply-To
<fc4ede3ecffd33811adca702493c8763@manjaro.org>

It seems to me that the two options are orthogonal: allowing the user to add an arbitrary prefix is not a block for allowing the user to clear the screen or vice-versa. If anything, the arbitrary prefix seems the more general flag to me as it at least offers a way (however unportable) to perform a clear. So saying that if we do not allow the user to clear the screen then it is not fine to add arbitrary prefixes seems strange.

On Thu, 28 Mar 2024 at 22:19, Dragan Simic <dsimic@manjaro.org> wrote:
Show 29 quoted lines
>
> On 2024-03-28 21:43, Junio C Hamano wrote:
> > Dragan Simic <dsimic@manjaro.org> writes:
> >
> >> Of course, users could pick the right escape sequences for their
> >> terminals, but as you already noted, the same configurations could
> >> end up being used on different terminals.  For example, even SSHing
> >> into a machine using a different SSH client could lead to a mess.
> >
> > There is a separate discussion of conditional configuration based on
> > environment variable settings, e.g.
> >
> >     [includeIf "env:TERM:vt100"]
> >       path = ~/.git-config-bits/vt100
> >
> > where the named file might have
> >
> >     [prompt] prefix = "\033[H\033[J"
> >
> > so it is certainly doable.
> >
> > It is a different story if doing so is sensible, of course.
>
> Quite frankly, I think that would be like opening a can of worms.
> In other words, if we end up implementing support for the "add -P"
> prefix, allowing the users to do whatever they want with the prefixes
> would surely be fine, but only if we implement "add -P" at the same
> time, to already provide a reliable and simple way for clearing the
> screen.
Previous: Dragan SimicNext: Dragan Simic
Message 13 of 14 in “Better visual separation of hunks in `git add -p`”
  1. Eugenio BargiacchiMar 28, 2024
  2. Junio C HamanoMar 28, 2024
  3. Eugenio BargiacchiMar 28, 2024
  4. Dragan SimicMar 28, 2024
  5. Junio C HamanoMar 28, 2024
  6. Dragan SimicMar 28, 2024
  7. Eugenio BargiacchiMar 28, 2024
  8. Dragan SimicMar 28, 2024
  9. Eugenio BargiacchiMar 28, 2024
  10. Dragan SimicMar 28, 2024
  11. Junio C HamanoMar 28, 2024
  12. Dragan SimicMar 28, 2024
  13. Eugenio BargiacchiMar 28, 2024
  14. Dragan SimicMar 28, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.