mgit2.0.2
04 / 07

Output, colour and glyphs

The format has not changed since 1.0, and colour is never the only thing carrying information.

Each repository is introduced by a header framed with 80 = characters, carrying the directory name and the current branch. A detached HEAD shows the short commit instead.

================================================================================
📂 Folder: web-console │ Branch: main
================================================================================
 M src/main.rs

-q / --quiet drops the header and leaves git's own output, with a blank line still separating the repositories.

Compare with and without --quiet: mgit --quiet

The summary

When any repository failed, a summary is printed before mgit exits. --summary prints it every time.

────────────────────────────────────────────────────────────────────────────────
mgit: 6 repositories, 5 succeeded, 1 failed
  ✗ web-console (exit code 128)

stdout and stderr

This is what makes mgit safe to put in a script: the summary goes to stderr by default and never pollutes stdout. mgit status -s > status.txt gives you clean data, and failures are still visible.

WhatGoes to
The per repository headerstdout
git's own outputwherever git writes it; mgit does not intercept it
The summary printed after a failurestderr
The summary requested with --summarystdout
The warnings about missing or unreadable directoriesstderr
The paths printed by --liststdout

Redirect it, then read the file back: mgit --summary > status.txt

Colour

Colour only appears when the output is attached to a terminal that supports it. The precedence is: the command line, then MGIT_*, then CLICOLOR_FORCE, then NO_COLOR / CLICOLOR, then terminal detection.

SituationResult
Output redirected to a file or a pipecolour is off
NO_COLOR set to a non empty valuecolour is off (no-color.org)
CLICOLOR_FORCE set to something other than 0colour is on
--color=alwaysalways on, overriding everything above
--color=never, --no-coloralways off, overriding everything above

Try NO_COLOR: NO_COLOR=1 mgit --summary

Glyphs and the ASCII fallback

The default glyphs are 📂, , and . When the terminal cannot render them, mgit switches to plain ASCII: Folder: … | Branch: …, x and -.

  • A Windows console whose output code page is not UTF-8 gets ASCII automatically.
  • A POSIX locale that is not UTF-8 (LANG=C, LC_ALL=POSIX) gets ASCII automatically.
  • --ascii forces ASCII, MGIT_ASCII=1 does the same, and MGIT_ASCII=0 forces the Unicode glyphs back.

Try the ASCII glyphs: MGIT_ASCII=1 mgit --summary