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

Re: "git log" does not display refs info when executed via C# Process class on Windows

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Aug 9, 2019, 19:50 UTC
Message-ID
<20190809195031.GK20404@szeder.dev>
In-Reply-To
<BN8PR21MB11569DAA8A677BF00113F683B7D60@BN8PR21MB1156.namprd21.prod.outlook.com>
On Fri, Aug 09, 2019 at 07:36:19PM +0000, Cliff Schomburg wrote:
Show 6 quoted lines
> I have an open Git for Windows issue here:
> https://github.com/git-for-windows/git/issues/2285
> 
> "git log" works as expected from the command prompt.  But when I execute it via C# Process class and read from Standard Output, the refs are missing.
> 
> Is anyone familiar with this issue?  Any idea why the output to CMD and STDOUT would be different?

Decorations, like color and refs pointing to a commit, are for humans, and humans read the terminal. If the command's output doesn't go to a terminal, then no such decorations are shown by default.

Try invoking 'git log --decorate'; or, better yet, use your custom '--format=', especially if you intend to parse the output,

Previous: Cliff SchomburgNext: Cliff Schomburg
Message 2 of 6 in “"git log" does not display refs info when executed via C# Process class on Windows”
  1. Cliff SchomburgAug 9, 2019
  2. SZEDER GáborAug 9, 2019
  3. Cliff SchomburgAug 9, 2019
  4. Cliff SchomburgAug 9, 2019
  5. Junio C HamanoAug 9, 2019
  6. Cliff SchomburgAug 9, 2019

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.