Re: Please, paint new branch errors in RED (or any visible color)
- From
Fabian Stelzer <fs@gigacodes.de>
- Date
- Dec 10, 2021, 16:42 UTC
- Message-ID
- <20211210164249.bahhe5ogjjhz4lxo@fs>
- In-Reply-To
- <211210.86r1akbes8.gmgdl@evledraar.gmail.com>
On 10.12.2021 17:32, Ævar Arnfjörð Bjarmason wrote:
Show 42 quoted lines
> >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.