git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Please, paint new branch errors in RED (or any visible color)
@ 2021-12-10 11:36 Jose Wielandt
  2021-12-10 16:32 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 8+ messages in thread
From: Jose Wielandt @ 2021-12-10 11:36 UTC (permalink / raw)
  To: git

Hi community,

At my work we've been struggling a lot with not realizing that our new
branch creation actually failed, ending up with a push directly to
develop. What are those cases?

$ git checkout -b feature/solve p-eq-np
fatal: Cannot update paths and switch to branch 'feature/solve' at the
same time.

What's my proposal?

$ git checkout -b feature/solve p-eq-np
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FATAL: CANNOT UPDATE PATHS AND SWITCH TO BRANCH 'feature/solve' AT THE SAME TIME

                 YOU STILL IN THE SAME BRANCH ! ! ! !

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

***(but in bright RED)***


Another case!

$ git branch feature/solve p-eq-np
fatal: Not a valid object name: 'p-eq-np'.

I'll let that one to your imagination but please, make it appear in
red so we can easily (visually) realize that something went wrong.


This has been the third time in a month we accidentally pushed changes
to develop bc we didn't realize that the command failed.

Thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-10 11:36 Please, paint new branch errors in RED (or any visible color) Jose Wielandt
@ 2021-12-10 16:32 ` Ævar Arnfjörð Bjarmason
  2021-12-10 16:42   ` Fabian Stelzer
  0 siblings, 1 reply; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-10 16:32 UTC (permalink / raw)
  To: Jose Wielandt; +Cc: git


On Fri, Dec 10 2021, Jose Wielandt wrote:

> Hi community,
>
> At my work we've been struggling a lot with not realizing that our new
> branch creation actually failed, ending up with a push directly to
> develop. What are those cases?
>
> $ git checkout -b feature/solve p-eq-np
> fatal: Cannot update paths and switch to branch 'feature/solve' at the
> same time.
>
> What's my proposal?
>
> $ git checkout -b feature/solve p-eq-np
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> FATAL: CANNOT UPDATE PATHS AND SWITCH TO BRANCH 'feature/solve' AT THE SAME TIME
>
>                  YOU STILL IN THE SAME BRANCH ! ! ! !
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> ***(but in bright RED)***
>
>
> Another case!
>
> $ git branch feature/solve p-eq-np
> fatal: Not a valid object name: 'p-eq-np'.
>
> I'll let that one to your imagination but please, make it appear in
> red so we can easily (visually) realize that something went wrong.
>
>
> This has been the third time in a month we accidentally pushed changes
> to develop bc we didn't realize that the command failed.

I think if we'd improve the output we'd probably add some "advice"
output, i.e. "hint:" lines, not ALL CAPS.

But have you tried to see if the "git switch" command has the same UX
caveats? It was meant to address some of these tricky/unexpected issues
in 'checkout'.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-10 16:32 ` Ævar Arnfjörð Bjarmason
@ 2021-12-10 16:42   ` Fabian Stelzer
  2021-12-10 19:09     ` Jose Wielandt
  0 siblings, 1 reply; 8+ messages in thread
From: Fabian Stelzer @ 2021-12-10 16:42 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jose Wielandt, git

On 10.12.2021 17:32, Ævar Arnfjörð Bjarmason wrote:
>
>On Fri, Dec 10 2021, Jose Wielandt wrote:
>
>> Hi community,
>>
>> At my work we've been struggling a lot with not realizing that our new
>> branch creation actually failed, ending up with a push directly to
>> develop. What are those cases?
>>
>> $ git checkout -b feature/solve p-eq-np
>> fatal: Cannot update paths and switch to branch 'feature/solve' at the
>> same time.
>>
>> What's my proposal?
>>
>> $ git checkout -b feature/solve p-eq-np
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>> FATAL: CANNOT UPDATE PATHS AND SWITCH TO BRANCH 'feature/solve' AT THE SAME TIME
>>
>>                  YOU STILL IN THE SAME BRANCH ! ! ! !
>>
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>> ***(but in bright RED)***
>>
>>
>> Another case!
>>
>> $ git branch feature/solve p-eq-np
>> fatal: Not a valid object name: 'p-eq-np'.
>>
>> I'll let that one to your imagination but please, make it appear in
>> red so we can easily (visually) realize that something went wrong.
>>
>>
>> This has been the third time in a month we accidentally pushed changes
>> to develop bc we didn't realize that the command failed.
>
>I think if we'd improve the output we'd probably add some "advice"
>output, i.e. "hint:" lines, not ALL CAPS.
>

Adding some color for die/error/warning() in general if we detect a tty 
might not a bad thing. I have encountered similar situations where an error 
gets lost in between `git log` output.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-10 16:42   ` Fabian Stelzer
@ 2021-12-10 19:09     ` Jose Wielandt
  2021-12-11  2:30       ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 8+ messages in thread
From: Jose Wielandt @ 2021-12-10 19:09 UTC (permalink / raw)
  To: Fabian Stelzer; +Cc: Ævar Arnfjörð Bjarmason, git

Yes, I git switch has the same behavior.
I also agree that add hints could be a good idea.

2021-12-10 13:42 GMT-03:00, Fabian Stelzer <fs@gigacodes.de>:
> On 10.12.2021 17:32, Ævar Arnfjörð Bjarmason wrote:
>>
>>On Fri, Dec 10 2021, Jose Wielandt wrote:
>>
>>> Hi community,
>>>
>>> At my work we've been struggling a lot with not realizing that our new
>>> branch creation actually failed, ending up with a push directly to
>>> develop. What are those cases?
>>>
>>> $ git checkout -b feature/solve p-eq-np
>>> fatal: Cannot update paths and switch to branch 'feature/solve' at the
>>> same time.
>>>
>>> What's my proposal?
>>>
>>> $ git checkout -b feature/solve p-eq-np
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>
>>> FATAL: CANNOT UPDATE PATHS AND SWITCH TO BRANCH 'feature/solve' AT THE
>>> SAME TIME
>>>
>>>                  YOU STILL IN THE SAME BRANCH ! ! ! !
>>>
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>
>>> ***(but in bright RED)***
>>>
>>>
>>> Another case!
>>>
>>> $ git branch feature/solve p-eq-np
>>> fatal: Not a valid object name: 'p-eq-np'.
>>>
>>> I'll let that one to your imagination but please, make it appear in
>>> red so we can easily (visually) realize that something went wrong.
>>>
>>>
>>> This has been the third time in a month we accidentally pushed changes
>>> to develop bc we didn't realize that the command failed.
>>
>>I think if we'd improve the output we'd probably add some "advice"
>>output, i.e. "hint:" lines, not ALL CAPS.
>>
>
> Adding some color for die/error/warning() in general if we detect a tty
> might not a bad thing. I have encountered similar situations where an error
>
> gets lost in between `git log` output.
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-10 19:09     ` Jose Wielandt
@ 2021-12-11  2:30       ` Ævar Arnfjörð Bjarmason
  2021-12-12 18:38         ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-11  2:30 UTC (permalink / raw)
  To: Jose Wielandt; +Cc: Fabian Stelzer, git


On Fri, Dec 10 2021, Jose Wielandt wrote:

> Yes, I git switch has the same behavior.
> I also agree that add hints could be a good idea.

I'll pick up this topic.

I have some patches I'm trickling in to improve the general UX of these
fatal/error/warning/hint etc. messages, one part of that is trying to
get this RFC series in incrementally (some patches are already on-list:
https://lore.kernel.org/git/RFC-cover-00.21-00000000000-20211115T220831Z-avarab@gmail.com/

Adding color to the output would be relatively easy. I'll get to it, and
feel free to send me a reminder in some months (which is realistically
when you'd see it in a release) if you don't see it.

Thanks for the suggestion, & for caring about git's UX.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-11  2:30       ` Ævar Arnfjörð Bjarmason
@ 2021-12-12 18:38         ` Junio C Hamano
  2021-12-12 19:01           ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2021-12-12 18:38 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jose Wielandt, Fabian Stelzer, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Fri, Dec 10 2021, Jose Wielandt wrote:
>
>> Yes, I git switch has the same behavior.
>> I also agree that add hints could be a good idea.
>
> I'll pick up this topic.

Please make sure color challenged users can configure it away or
customize it somehow.

Making it opt-in is even better, but it is my personal taste.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-12 18:38         ` Junio C Hamano
@ 2021-12-12 19:01           ` Ævar Arnfjörð Bjarmason
  2021-12-12 22:27             ` Eric Sunshine
  0 siblings, 1 reply; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-12 19:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jose Wielandt, Fabian Stelzer, git


On Sun, Dec 12 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Fri, Dec 10 2021, Jose Wielandt wrote:
>>
>>> Yes, I git switch has the same behavior.
>>> I also agree that add hints could be a good idea.
>>
>> I'll pick up this topic.
>
> Please make sure color challenged users can configure it away or
> customize it somehow.

Yes, I think it's a bug if we add any such coloring that isn't
configurable via the usual color.* configuration. Although in this case
it's usage.c. So perhaps "color.usage" (as in usage.c). But that squats
on any future hypothetical "git usage". So maybe "color.coreUsage" (a
"color.core.usage" would squat on any future "color.core.usage.<slot>"
(i.e. there's no 4-level keys)>

> Making it opt-in is even better, but it is my personal taste.

*nod*. I'll see how it turns out. FWIW I think that it's probably too
over-colored to do:

    <RED>fatal: the message</RED>

And it's probably better to just do:

    <RED>fatal</RED>: the message

But I'll see once we have actual examples. The advice output is
fully-colored now. I.e. "hint: message", not just the "hint" part...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Please, paint new branch errors in RED (or any visible color)
  2021-12-12 19:01           ` Ævar Arnfjörð Bjarmason
@ 2021-12-12 22:27             ` Eric Sunshine
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Sunshine @ 2021-12-12 22:27 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Junio C Hamano, Jose Wielandt, Fabian Stelzer, git

On Sun, Dec 12, 2021 at 4:22 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> Yes, I think it's a bug if we add any such coloring that isn't
> configurable via the usual color.* configuration. Although in this case
> it's usage.c. So perhaps "color.usage" (as in usage.c). But that squats
> on any future hypothetical "git usage". So maybe "color.coreUsage" (a
> "color.core.usage" would squat on any future "color.core.usage.<slot>"
> (i.e. there's no 4-level keys)>
>
> > Making it opt-in is even better, but it is my personal taste.
>
> *nod*. I'll see how it turns out. FWIW I think that it's probably too
> over-colored to do:
>
>     <RED>fatal: the message</RED>
>
> And it's probably better to just do:
>
>     <RED>fatal</RED>: the message
>
> But I'll see once we have actual examples. The advice output is
> fully-colored now. I.e. "hint: message", not just the "hint" part...

As a minor bikeshedding datapoint, a script I wrote a few years ago
highlights outdated entries in a larger output. The highlighting is
applied only to a single word ("outdated") on one line related to the
item, and I found that my eye would regularly glide right over the
highlighting in the somewhat voluminous output without ever seeing the
highlight. Very recently, I changed it to highlight the entire line,
and that has helped me take more notice of it (though, admittedly, I
still sometimes still overlook the highlighted item).

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-12 22:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 11:36 Please, paint new branch errors in RED (or any visible color) Jose Wielandt
2021-12-10 16:32 ` Ævar Arnfjörð Bjarmason
2021-12-10 16:42   ` Fabian Stelzer
2021-12-10 19:09     ` Jose Wielandt
2021-12-11  2:30       ` Ævar Arnfjörð Bjarmason
2021-12-12 18:38         ` Junio C Hamano
2021-12-12 19:01           ` Ævar Arnfjörð Bjarmason
2021-12-12 22:27             ` Eric Sunshine

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).