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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Strangely, when I run this command:

Git log origin/master --pretty=oneline --decorate -1

I get the format I want from STDOUT.  However, when I try to filter it to show only the tag refs:

Git log origin/master --pretty=oneline --decorate --decorate-refs=^tag* -1

No refs are returned to standard output again.  Only on the command line.

Does --decorate-refs not return to STDOUT?

Thanks,
Cliff

-----Original Message-----
From: SZEDER Gábor <szeder.dev@xxxxxxxxx> 
Sent: Friday, August 9, 2019 3:51 PM
To: Cliff Schomburg <clisc@xxxxxxxxxxxxx>
Cc: git@xxxxxxxxxxxxxxx
Subject: Re: "git log" does not display refs info when executed via C# Process class on Windows

On Fri, Aug 09, 2019 at 07:36:19PM +0000, Cliff Schomburg wrote:
> I have an open Git for Windows issue here:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Fgit-for-windows%2Fgit%2Fissues%2F2285&amp;data=02%7C01%7Cclis
> c%40microsoft.com%7C17689ee8d32d48528c3208d71d02d8d5%7C72f988bf86f141a
> f91ab2d7cd011db47%7C1%7C0%7C637009771013658738&amp;sdata=PKPdRI0mC65Lx
> 2J5etYnp0fyzsk%2BXSGzGBWa12BLKEE%3D&amp;reserved=0
> 
> "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, 





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux