Re: [msysGit] [PATCH 10/12] Add ANSI control code emulation for the Windows console
- From
Johannes Sixt <johannes.sixt@telecom.at>
- Date
- Jul 7, 2008, 18:41 UTC
- Message-ID
- <200807072041.00680.johannes.sixt@telecom.at>
- In-Reply-To
- <1214987532-23640-10-git-send-email-prohaska@zib.de>
On Mittwoch, 2. Juli 2008, Steffen Prohaska wrote:
> This adds only the minimum necessary to keep git pull/merge's diffstat from > wrapping. Notably absent is support for the K (erase) operation, and > support for POSIX write.
I've tested this patch, and it is no longer ready for prime-time in its current form. It doesn't do what it advertises (colorize diffstat of merge) because the diff machinery since some time now uses fprintf, not printf, so the replacements are not called and escape characters are left in the console window.
Show 8 quoted lines
> +#ifdef WIN_ANSI > +extern int git_fputs(const char *str, FILE *stream); > +extern int git_printf(const char *format, ...) __attribute__((format > (printf, 1, 2))); +#define fputs git_fputs > +#define printf(...) git_printf(__VA_ARGS__) > +#endif > + > #endif
Put this (without #ifdef WIN_ANSI) in mingw.h and don't change the Makefile.
-- Hannes